| View previous topic :: View next topic |
| Author |
Message |
primeminister Site Admin

Joined: 16 Apr 2006 Posts: 94 Location: Netherlands
|
Posted: Mon Sep 03, 2007 10:39 pm Post subject: trying to figure out Date Timezones |
|
|
Hi,
I'm a bit lost in the whole converting timezone issues in Date.
What I'm trying to do is:
[list=]
Get the current date.
Convert to UTC
[/list]
But the current date is based in the server timezone. So I set the timezone manually with setTZById() and then the toUTC.
But I get wrong numbers everywhere and it has something to do with daylight saving time.
| Code: |
$oNow = new Date();
$tz = exec('date "+%Z"');
$oNow->setTZById($tz);
$oNow->toUTC();
|
My $tz is 'CEST' which means CET in daylight saving time.
Is it converted automatically?
Or do I have to subtract the offset myself?
And is the inDaylightTime() function working?
Thnx! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|