0

I want to get Timezone name in Australia/Sydney (not a time)

http://php.net/manual/en/timezones.australia.php (timezone set)

$t = new DateTime('now'); 
$t->setTimeZone( new DateTimeZone('Australia/Sydney'));
echo $t->format("Y D M j H:i T");

And result = 2014 Tue Dec 16 17:54 EST

http://www.timeanddate.com/time/zones/aedt

In this URL, Australia/Sydney is AEDT. Why php return EST?

user3273401
  • 35
  • 1
  • 10

2 Answers2

2

Hope this work for you

$test = new DateTimeZone('Australia/Sydney');
$gmt = new DateTimeZone('AEDT');

$date = new DateTime('2011-12-25 00:00:00', $test);
$date->setTimezone($gmt);
echo $date->format('Y-m-d H:i:s');
  • Thank you for answer. But I want to see whether the Sydney now daylight saving time in the time zone display. And I think i find the answer -> http://mm.icann.org/pipermail/tz-announce/2014-August/000023.html – user3273401 Dec 16 '14 at 07:15
1

http://mm.icann.org/pipermail/tz-announce/2014-August/000023.html

Australia DST timezone abbreviation incorrect when using date_default_timezone_set

It was version issue.

Community
  • 1
  • 1
user3273401
  • 35
  • 1
  • 10