Forum Moderators: open
I been developing a javascript application that needs the date object to stay fixed in GMT with +0 hrs offset and not to be determined or effected by the users local system settings for timezone offset.
The time I'm passing to the javascript is the servers epoch time (GMT based server) with this file being uploaded and then included (ssi) into the javascript.
now = new Date(fixed time in milliseconds);
The problem is that although everything tells me that this is the fixed time when I change the PC's system settings for another timezone apart from GMT it throws everything out and in the browser (mainly IE5/6, Opera) adds an undesired timezone offset.
I'm would be really interested in finding out how to kill off the effects of the users local timezone settings that seem to cause my application to stray from GMT.
I would also be interested in how the actual timezone is being applied by the browser and why it seems impossible to stop it effecting the javascript, simply and can I get my script to ignore this.
All I'm using from the new Date object is ddmmyyhh and ideally for that to remain unaffected by the users local time settings.
I would really appreciate anyone's help loads on sorting this.
many thanks, matc
I had a look at UTC's options and found that I could remove the dependency on local timezone look up from the javascript by using this.
var now = new Date();
now.setTime(Date.parse("May 14, 2005 14:00:00"));
The main reason why this date and time is worked out on a separate server is because I need a slight delay before croning the time and date update (SSI file) up to live.
Thanks for the shout on this and thumbs up to UTC as well.
cheers, matc