Methods and Properties of the Date Object : Date « Development « JavaScript DHTML






Methods and Properties of the Date Object

Method
getDate()        Returns the date within month (1 to 31).
getDay()         Returns the day within the week (0 to 6).
getFullYear()    Returns the year in local time with four digits. 
getHours()       Returns the hour within the day (0 to 23).
getMilliseconds()  Returns the milliseconds.
getMinutes()      Returns the minutes within the hour (0 to 59).
getMonth()        Returns the month within the year (0 to 11).
getSeconds()      Returns seconds within the minute (0 to 59).
getTime()         Returns the number of milliseconds since 1/1/70 00:00:00.
getTimeZoneOffset()  Returns minutes offset from GMT/UTC.
getUTCDate()      Returns the day of the month.
getUTCDay()       Returns the day of the week converted to universal time.
getUTCFullYear()  Returns a four-digit representation of the year converted to universal time.
getUTCHours()     Returns the hour converted to universal time.
getUTCMilliseconds()Returns the milliseconds converted to universal time. 
getUTCMinutes()   Returns the minutes converted to universal time. 
getUTCMonth()    Returns the month converted to universal time.
getUTCSeconds()   Returns the seconds converted to universal time. 
getYear()        Returns number of years since 1900.
parse()          Converts the passed-in string date to milliseconds.
setDate()        Sets the date within the month (1 to 31).
setFullYear()     Sets the year as a four-digit number.
setHours()        Sets hour within day (0 to 23).
setMilliseconds()  Sets the milliseconds.
setMinutes()     Sets the minutes within the hour (0 to 59).
setMonth()       Sets the month within the year (0 to 11).
setSeconds()     Sets the seconds within the minute (0 to 59).
setTime()        Sets the number of milliseconds since 1/1/70 00:00:00.
setUTCdate()     Sets the day of the month in universal time. 
setUTCFullYear()   Sets the year as a four-digit number in universal time.
setUTCHours()     Sets the hour in universal time.
setUTCMilliseconds()  Sets the milliseconds in universal time.
setUTCMinutes()   Sets the minutes in universal time.
setUTCMonth()    Sets the month in universal time.
setUTCSeconds()   Sets the seconds in universal time.
setYear()         Sets the number of years since 1900.
toGMTString()    Returns the date string in universal format.
toLocalString()    Returns the date string in the local system's format.
toSource()        Returns the source of the Date object.
toString()        Returns the date and time as a string in local time.
toUTCString()     Returns the data and time as a string in universal time (UTC). 
UTC()             Convertscomma-delimited values to milliseconds of UTC date.
valueOf()         Returns the equivalence of the Date object in milliseconds.
Property

prototype         Property that allows you to add methods and properties to the Date object.
           
       








Related examples in the same category

1.Demo all methods in Date class
2.how many days Between two dates
3.Today's Date
4.Display date: day month year in string
5.Date: date, month, and year.
6.Set date: setDate, setHour
7.UTC time: getUTCDate returns the Universal Coordinated Time
8.Display weekday: name of the current day
9.Display full date : complete date with the day name and month name
10.Display time: continues writing time per second.
11.Date: Week of the year
12.Display current date: year, month day in number
13.Extending the Date Object to Include Some New Methods
14.Using the Date Object
15.Output day
16.A Dynamic Welcome Message
17.How Many Days Until Christmas
18.Summer Games Countdown
19.Simple Date Validation
20.GMT Calculator
21.Days Before Next Christmas Xmas
22.Get how many days before a date