...

View Full Version : $date, wrong in my timezone...



tomyknoker
09-03-2007, 08:29 AM
I have a simple date variable which I am e-mailing,
$date = date('d/m/Y');, but the date comes in a day behind, does it pull it off my server? Is it possible to make the date specific to my timezone... Which is Australia...

Mwnciau
09-03-2007, 08:32 AM
If you do the time as well, how many hours behind is it?


putenv("TZ=Australia/Sydney");
Put that at the start of your script and it should be the right time

tomyknoker
09-03-2007, 08:33 AM
Jeez I don't know the server is in LA and I'm in Sydney... It's 5.30pm on Monday here...

tomyknoker
09-03-2007, 08:36 AM
What about if I do something like this:


putenv("TZ=AU/Eastern");

Mwnciau
09-03-2007, 08:37 AM
putenv("TZ=Australia/Sydney");

kyle2k
09-03-2007, 08:42 AM
Hi,
The way I do it is as below.

$date = date('Ymd', strtotime('-15 hours'));

Hope this helps Kyle

tomyknoker
09-03-2007, 08:52 AM
But don't I need to have it AU/Eastern?

Mwnciau
09-03-2007, 08:56 AM
Its Australia/Sydney

http://www.theprojects.org/dev/zone.txt



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum