Get timezone offset in PHP given a unix timestamp

De openkb
Aller à : Navigation, rechercher

Sommaire

Questions

I have a Unix timestamp that comes from a database that is (unfortunately) in a timezone with a certain of either +3600 or +7200, depending on if it s DST or not. This has never been a problem before, but our website is currently moving to a more international audience and because of Javascript interaction with said timestamps, I need to convert the timestamp without any offset.

So, how do I, given just a Unix timestamp, get the offset for the timezone, at the moment of that timestamp? I m looking through the PHP docs, but there s so many date/time functions I m a bit lost.

I m using PHP 5.2.3

Answers

http://us.php.net/manual/en/function.gmstrftime.php http://us.php.net/manual/en/function.gmstrftime.php

Source

License : cc by-sa 3.0

http://stackoverflow.com/questions/1536639/get-timezone-offset-in-php-given-a-unix-timestamp

Related

Outils personnels
Espaces de noms

Variantes
Actions
Navigation
Outils