Forum Moderators: coopster

Message Too Old, No Replies

Date tim function for Australia?

         

adammc

11:20 pm on Sep 2, 2004 (gmt 0)

10+ Year Member



Hi,
I am trying to get my script to display the current time in Cairns Australia but it is displaying 10hours behind?

$time = gmdate("dS F Y, G:i", time() + $offset);
$offset = 3600*10;


the time zone for cairns: UTC/GMT +10 hours

jatar_k

11:45 pm on Sep 2, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



swap the 2 lines and try

$offset = 3600*10;
$time = gmdate("dS F Y, G:i", time() + $offset);

adammc

1:12 am on Sep 3, 2004 (gmt 0)

10+ Year Member



Peeeerfect!
Thanks Jatar ;)

dcrombie

10:34 am on Sep 3, 2004 (gmt 0)



Before you call date set the timezone to a relevant city/region:

putenv("TZ=Australia/ACT");

;)