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! |
today = new Date(); // current Date and Time |
now = new Date("February 26, 1996 15:13:00"); /* sets now to date/time these notes were prepared! */ |
Both Java and JavaScript store dates internally as number of elapsed milliseconds since January 1, 1970 00:00:00. |
In a Java, Date.UTC(date as bunch of numbers) and Date.parse(date as a text string) are static methods |
There are methods such as getMonth that extract the month from a date |
See the online resource for all possible methods! |