[Javascript] Q on TimeZone

Walter Torres walter at braverock.com
Wed Sep 12 09:59:54 CDT 2001


On Tue, 11 Sep 2001, Hassan Schroeder wrote:

> Walter Torres wrote:
>
> > I live in Chicago, it is minus 6 hours from GMT.
> >
> > But this...
> >
> >         var mine = new Date();
> >         var TZmine = mine.getTimezoneOffset();
> >
> > returns
> >
> >       300  // which is 5 hours
> >
> > Shouldn't this be negative 6?
>
> nope, the TimezoneOffset is the difference in minutes between
> local time and GMT; for you, GMT is "later" and therefore its
> value is a larger (positive) number of minutes.

I understand that it return minutes.

So, if I set my time for Moscow, will that give me negative?

I need to convert what this method returns into a real hours from GMT.

That mean minus for Western Hemisphere.


> > Also, I need to create a new Date and define a GMT offset.
>
> Not sure I understand "define a GMT offset" ... clarify?

Be glad to clarify...

I have a database that contains timestamps, and GMT offsets.

I want to convert these values into Date Objects.

Thanks

Walter





More information about the Javascript mailing list