Reputation: 5193
time()
keeps producing the same timestamp , even though in my php.ini I keep toggling between
date.timezone = "Asia/Irkutsk"
and
date.timezone = "Europe/Belgrade"
phpinfo():
date/time support enabled
"Olson" Timezone Database Version 2012.3
Timezone Database internal
Default timezone Asia/Irkutsk
date/time support enabled
"Olson" Timezone Database Version 2012.3
Timezone Database internal
Default timezone Europe/Belgrade
Timestamps stays the same. Howcome?
Upvotes: 2
Views: 1842
Reputation:
I was having this problem and spoke to my host, they explained that any timezone setting in php.ini is ignored and that the .htaccess file must be changed as follows;
Add this to .htaccess
php_value date.timezone "Europe/London"
Then display using
echo date('d-m-Y H:i');
Upvotes: 0
Reputation: 99523
You made the wrong assumption.
Unix timestamps are always in UTC. No exception. Changing the timezone does not change the exact moment of the epoch (1st of january, 1970), so the number of seconds since then will always be 'correct'.
Upvotes: 3