Playing with timezone conversions can be crazy, it still confuses me every time and I have to wait a minute to run some test code to figure out what’s it that I am trying to do here.

Anyway, the quickest way I have to get timestamp of a time in particular time zone is

.gist table { margin-bottom: 0; }

DateTime and DateTimeZone classes are what you need to know when dealing with timezones, ditch any other method of doing conversions in PHP. Seriously, there are no better ways of doing it.

And just a tip, if you already don’t know, timestamp from different timezones for a single point of time is same. It doesn’t depend on the timezone. Did you know? ????

Let me know in the comments if you have a question.

The post Quickest way to get timestamp of a time in a particular timezone in PHP appeared first on Ashfame | Blog.