timezone - PHP Date to strtotime and back to date? -


what want convert time string strtotime , date timezone had before.

i using following code, time result in utc:

$timestart = "2013-04-25 18:14:00+03"; $datetimestart = strtotime($timestart); $datetimenext = strtotime('+8 hours',$datetimestart); $time = gmdate('y-m-d\\th:i:s\\z', $datetimenext); 

any ideas? thank you..

i think mean want same offset had. read "timezone != offset" in the timezone tag wiki.

the main problem request strtotime (according the docs) returns integer representing number of seconds epoch in utc. offset provide going factored in forgotten about.

sorry don't know php enough provide code sample, can extract offset original string , re-apply @ end. possible there different way parse string yield object maintains offset. again, don't know php enough here. in .net same problem solved parsing datetimeoffset instead of datetime.

also - logistically offset start not correct offset use after add time. might have crossed daylight savings time transition, make new correct offset hour less or hour more original offset. may or may not care this, depending on concerns. way correct offset after edit know time zone original value in.


Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -