Thanks Hans, that worked well. The text book was way out with the spelling
and capitalisation of those functions and the "Sting " was my typing
mistake.
----- Original Message -----
From: Hans Jörg Friedrich <hans.friedrich@n...>
To: javascript <javascript@p...>
Sent: Monday, January 22, 2001 6:33 PM
Subject: [javascript] Re: time functions
> Hello,
>
> In your text the methodnames were spelled wrong. If you use them in your
> code like you wrote them it can't work.
>
> DateObject.getTimezoneOffset() ( with a lower case 'z')
> DateObject.toLocaleString ( local with an 'e' and Sting with a 'r' )
>
> I didn't find an error in your toGMTString-clause so try the following
code
> as is. It worked well with IE5 and NN4.75
> The output is listed below.
>
> Greetings Hans
>
> <HTML>
> <HEAD>
> <TITLE></TITLE>
> </HEAD>
> <BODY>
> <script language="JavaScript">
> <!--
> var dateObject=new Date();
> var gmtDate=dateObject.toGMTString();
> var LocDate=dateObject.toLocaleString();
> var TZDate=dateObject.getTimezoneOffset();
> document.writeln("<br>date: \t" + dateObject.toString());
> document.writeln("<br>gmt: \t" + gmtDate);
> document.writeln("<br>local: \t" + LocDate );
> document.writeln("<br>Timezone: \t" + TZDate );
> file://-->
> </script>
> <P> </P>
>
> </BODY>
> </HTML>
>
> Output:
>
> datum: Mon Jan 22 09:23:17 UTC+xxxx xxxx
> gmt: Mon, 22 Jan 2001 08:23:17 UTC
> local: 01/22/2001 09:23:17
> Timezone: -60
>
>
> ----- Original Message -----
> From: <gdabre@o...>
> To: "javascript" <javascript@p...>
> Sent: Sunday, January 21, 2001 4:55 AM
> Subject: [javascript] time functions
>
>
> > How do I use the built-ins getTimeZoneOffset() ?
> >
> > systime = new Date();
> > systime.getTimeZoneOffset();
> >
> > does not work ???
> > Debug says the function is unrecognisable.
> >
> > I have the same problem with toGMTString() and toLocalSting()
> >
> > Thanks
> > Glenn
> >
>