The CMS that I use allows me to access the time offset of the user from the time UTC / GMT. So, if the user set their time zone for EST, then this offset will be "-5."
What I am doing right now when I need to display the current time is something like:
date('M j Y h:i A', time() + $offset*3600)
This works except when daylight saving time affects the user and then lags behind by an hour.
So my question is, how can I determine if a given time offset (for example, "-5") should add an hour to it?
source
share