i really need to get Helsinki and Moscow current time using javascript but regardless of local timezone. I wonder how to do that? Maybe anyone has an example?
The format would be:
November 1, 2011 21:31:00
thank you.
i really need to get Helsinki and Moscow current time using javascript but regardless of local timezone. I wonder how to do that? Maybe anyone has an example?
The format would be:
November 1, 2011 21:31:00
thank you.
The following function works when you know the offset ahead of time:
The above will always work for Moscow, which no longer observes a Daylight Savings Time, but you'd need to be aware of what time of year it is to make an equivalently generic solution for Helsinki.
(Sorry, don't know Helsinki offset, probably 2?)
Note that a negative return value from getTimezoneOffset() indicates that the current location is ahead of UTC, while a positive value indicates that the location is behind UTC.
[edit]
This may work better: (note that you will have to manipulate the format yourself from the recv'd
helsinki
variable[/edit]