Re: Calculating Past Dates In A Different Time Zone
| From: | Tamara Temple | Date: | Sun, 10 Nov 2013 23:02:53 +0000 |
| Subject: | Re: Calculating Past Dates In A Different Time Zone | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-48831@lists.php.net to get a copy of this message | ||
On Nov 10, 2013, at 10:26 AM, Ron Piggott <ron.piggott@actsministries.org> wrote:
> I normally use the following code to convert between time zones. But I don’t know how to
> calculate what time it is in GMT time zone when it is midnight in the users time zone X days ago, or
> midnight on November 1st 2013 in the users time zone.
The time zone offset will always be the same, regardless of what day it is…
Let’s say the user is in US CST, the offset to GMT/UTC is always 6 hours. If the prior date lies
within the local DST designation, you can still use that info, in which the offset will be 5 hours.
The major glitch happens during the midnight before switching to/from DST, but that’s just a
special case.