Double 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
6:30 UTC
Read the original article
Hit count: 434
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 double that to +8... and have it resolved to Asia/HonkKong
Language: PHP
Here's a sample of what it would look like:
$timezone = "Asia/Dubai"
$offset = $timezone->getOffset();
$offset *= 2;
$timezone = $offset->getTimeZone();
Output: Asia/HonkKong
© Stack Overflow or respective owner