Reputation: 3646
I've faced a very weird behaviour of php date()
function.
See this code:
date_default_timezone_set('Australia/Melbourne');
echo date('P', 1475000000) . ' ' . date('P', 1475700000);
It returns +10:00 +11:00
While it must be always +10:00
. Unix timestamps don't content timezone in it that's why date()
must return just currently configured timezone.
PHP version 5.6.23
Any ideas why is that?
Upvotes: 2
Views: 47
Reputation: 2839
http://www.australia.gov.au/about-australia/facts-and-figures/time-zones-and-daylight-saving
Your second timestamp is with DST. The first one is not yet.
Upvotes: 0
Reputation: 3646
I found an answer.
It's because Australia changes time on 2nd October. One timestamp is before it, while another is after, that's why all correct. Thanks all for attention.
Upvotes: 3