HELP! * GREY=local LOCAL HTML version of Foils prepared 15 January 1997

Foil 44 The Date Object in JavaScript

From JavaScript Tutorial for CPS616 Technologies of the Information Age 1997 Basic Information Track of CPS -- Spring Semester 97. by Geoffrey C. Fox * Important Information in IMAGE
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 Wed Feb 19 1997