HELP! * YELLOW=global GREY=local Global HTML version of Foils prepared 21 February 97

Foil 39 The Date Object in JavaScript

From Feb 17/19 Delivered Lecture for Course CPS616 -- aJavaScript Language Objects and Frames CPS616 spring 1997 -- Feb 17 and 19 1997. by Geoffrey Fox * Important Information in IMAGE
Secs 54.7 Addon
JavaScript really needs the powerful text processing capabilities of PERL -- Lets hope either Netscape adds them or somebody builds these functions
On the otherhand JavaScript like Java has an amazing number of capabilities associated with the Date object including 21 builtin methods
today = new Date(); // sets today to current Date and Time
asiwrite = new Date("February 26, 1996 15:13:00"); // sets asiwrite to date and time that these notes were prepared!
Note both Java and JavaString store dates internally as number of elapsed milliseconds since January 1,1970 00:00:00.
In a Java lookalike, Date.UTC(date as bunch of numbers) and Date.parse(date as a text string) are "class or static" methods
There are methods such as getMonth which extracts month from a date
See the online resource for all possible methods!


Northeast Parallel Architectures Center, Syracuse University, npac@npac.syr.edu

If you have any comments about this server, send e-mail to webmaster@npac.syr.edu.

Page produced by wwwfoil on Fri Feb 21 1997