Jump to content

Timezone issue for NT & WA in Australia


duckmannz

Recommended Posts

Hi

 

We have several LAMP servers across Australia and have a problem with our servers in Perth and Darwin where the time according to PHP is always 30 minutes behind the actual time. An example...

Server is located in Darwin:

  • CLI "date" returns "Sat Jun  2 18:53:32 CST 2007"
  • MySQL "SELECT NOW();" returns "2007-06-02 18:54:48"
  • And PHP "date('D d-M-Y H:i:s T')" returns "Sat 02-Jun-2007 18:26:07 EIT"

 

Is there a simple reason for this? There is no DST for Darwin in 2007.

 

Thanks!

Link to comment
Share on other sites

  • 4 weeks later...

errrrrrrr.

if you know it's always 30 minutes behind, you can always account for it by adding the 30 minutes on in every script, but that sounds like a drag.

 

You could set the system clock forward to the correct time if you have that kind of access.

 

I think the reason that two methods are returning the different times is probably because you're hosting php and mysql on different servers. Do you own these servers or are they through a third party?

Link to comment
Share on other sites

Both mysql and apache2 are on the same physical server and I'm the admin of the servers so I can try anything!

 

Currently I'm putting

date_default_timezone_set("Australia/Perth");

or

date_default_timezone_set("Australia/Darwin");

to accomodate the difference but like you said -- that's messy!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.