JRS: In article <
[email protected]>, dated
Sun, 30 Jan 2005 10:20:04, seen in Geoff
Berrow said:
The OP just wants to offset the date by a fixed amount to compensate for
the fact that the server is in the States. So he could either add a
known number of seconds to time() or use strtotime()
$timestamp=strtotime(+n hours); //where n is the time difference
$initstartdate = date("d-m-Y",$timestamp);
Not sure how daylight saving would affect that though.
As long as you allow "fixed" to mean "changes at least twice a year, and
possibly four times", you see no problem.
The server should be serving time in GMT; to suit the local natives'
whims, it may also serve native civil time. But one should only get GMT
or UTC from a server (UK servers probably serve UTC illegally).
If the OP's users want their local time, their machines can tell them
that, if properly set, which is their responsibility.
If it is necessary to relate civil time at places remote from the user
to UTC, then it is necessary to know the Time Zone and Summer Time Rules
for each remote place, which can be expressed as a TZ string (that may
rule out Israel; JJC?). Then, by careful reading of the FAQ of this
newsgroup, one can see how to convert UTC into remote civil time.
The OP's question is not well expressed; but offsetting a date/time by a
given amount of absolute or civil time is not difficult in javascript,
though frequently done wrongly.