Sample code from Intro to The JavaScript Date Object at the JavaScript/Java site at BellaOnline.com
For the following examples, we have set Pico's birthday as follows:
var picoBarkday = new Date("December 20 1999")
methodexampleresultNote
getDay()picoBarkday.getDay()Day of Week, Sunday is day 0
getDate()picoBarkday.getDate()Day of Month
getMonth()picoBarkday.getMonth()Programmers count from 0, so this is December
getFullYear()picoBarkday.getFullYear()4 Digit Year
getTime()picoBarkday.getTime()JavaScript actually keeps track of time in Milliseconds since January 1st, 1970, this is that number


copyright 2007 Julie L Baumler