Basic HTML version of Foils prepared 23 June 1997

Foil 44 JavaScript Date Objects

From JavaScript Tutorial for Certificate Course UC Web applications Certificate -- Summer 97. by Geoffrey C. Fox, Tom Scavo

Examples of JavaScript Date Object for Foil 44
1 JavaScript really needs the powerful text processing capabilities of PERL. (Lets hope either Netscape adds them or somebody builds them.) On the other hand, JavaScript (like Java) has 21 built-in methods associated with the Date object!
2 today = new Date(); // current Date and Time
3 now = new Date("February 26, 1996 15:13:00"); /* sets now to date/time these notes were prepared! */
4 Both Java and JavaScript store dates internally as number of elapsed milliseconds since January 1, 1970 00:00:00.
5 In a Java, Date.UTC(date as bunch of numbers) and Date.parse(date as a text string) are static methods
6 There are methods such as getMonth that extract the month from a date
7 See the online resource for all possible methods!

in Table To:


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 Apr 1 1998