Reverse Timezone offset
Posted
by gAMBOOKa
on Stack Overflow
See other posts from Stack Overflow
or by gAMBOOKa
Published on 2010-05-23T06:26:33Z
Indexed on
2010/05/23
7:00 UTC
Read the original article
Hit count: 369
I have a timezone name and I want the name of the timezone double its offset.
For instance, Asia/Dubai is -4, I want to reverse that to -4... and have it resolved to EDT
Language: PHP
Here's a sample of what it would look like:
$timezone = "Asia/Dubai"
$offset = $timezone->getOffset();
$offset += 2*$offset;
$timezone = $offset->getTimeZone();
Output: EDT
© Stack Overflow or respective owner