php - Timezones and summer time in different states -
i have problem php imap timezones.
i have server download emails users accounts. , users can view email on website.
i set php timezone of server utc 0 , want users see receiving time of emails timezones. problem summer time because timezone change of 1 hour.
example:
gmail give me email received time in utc (0) @ 7:00.
in italy, timezone utc +1 can add 1 hour time, 8:00.
but in italy have summer timezone utc must +2 not +1 not countries have this. ask if exists maybe online service can give me correct offset must add hour showing correct time.
thank in advance.
in italy time zone swaps between cet , cest cannot hard-code using names not reflect fact. need use geographical identifiers europe/rome
:
<?php $utc = new datetimezone('utc'); $rome = new datetimezone('europe/rome'); $winter = new datetime('2013-12-31', $utc); $summer = new datetime('2013-08-31', $utc); $winter->settimezone($rome); $summer->settimezone($rome); echo $winter->format('r') . php_eol; echo $summer->format('r') . php_eol;
tue, 31 dec 2013 01:00:00 +0100 sat, 31 aug 2013 02:00:00 +0200
Comments
Post a Comment