Javascript-date Object

Source: Internet
Author: User
Tags local time time and seconds

Dateobjects are the date (time) objects that we often say.

DateObjects are primarily used to enable basic storage, retrieval, and calculation of dates and Times.

This object is supported by all major Browsers.

The genus of the date object
Properties Description
Constructor Returns the constructor that created the Object.
Prototype Returns the prototype object of the function that created the object
Method of the Date object
Method Description
Date () The constructor returns the current date and time (called directly) or constructs a new Date object (using the new keyword).
GetDate () Returns the Date object part value (1 ~ 31).
GetDay () Returns the value of the "week" portion of the Date object (0 ~ 6).
getFullYear () Returns the actual value of the year section of the date Object.
GetHours () Returns the value of the "hour" portion of the Date object (0 ~ 23).
Getmilliseconds () Returns the value of the "milliseconds" portion of the Date object (0 ~ 999).
Getminutes () Returns the value of the "minutes" portion of the Date object (0 ~ 59).
GetMonth () Returns the value of the month portion of the Date object (0 ~ 11).
Getseconds () Returns the value of the "seconds" portion of the Date object (0 ~ 59).
GetTime () Returns the number of milliseconds between the Date object and midnight UTC January 1, 1970.
getTimezoneOffset () Returns the minute difference between local time and Greenwich Mean Time (gmt).
getUTCDate () Returns the numeric value (1 ~ 31) of the Date object in the dates section, based on UTC Time.
GetUTCDay () Returns the value of the "week" portion of the Date object based on the UTC time (0 ~ 6).
getUTCFullYear () Returns the value of the year part of the Date object based on UTC Time.
getUTCHours () Returns the value of the "hour" portion of the Date object (0 ~ 23) based on UTC Time.
getUTCMilliseconds () Returns the value of the "millisecond" portion of the Date object (0 ~ 999) based on UTC Time.
getUTCMinutes () Returns the value of the "minutes" portion of the Date object (0 ~ 59) based on UTC Time.
getUTCMonth () Returns the value of the month part of the Date object (0 ~ 11) based on UTC Time.
getUTCSeconds () Returns the value of the "seconds" portion of the Date object based on the UTC time (0 ~ 59).
GetYear () Obsolete please use the getFullYear () method Instead.
Parse () The static function returns the number of milliseconds between the specified date (string) and midnight UTC January 1, 1970.
SetDate () Sets the numeric value of the date section in a Date object (1 ~ 31, but not limited to).
setFullYear () Sets the actual value of the year section in the date Object.
Sethours () Sets the value of the Hours section in the Date object (0 ~ 23, but not limited to).
Setmilliseconds () Sets the value of the "millisecond" portion of the Date object (0 to 999, but not limited to).
Setminutes () Sets the value of the Minutes section in the Date object (0 ~ 59, but not limited to).
Setmonth () Sets the value of the month section in the Date object (0 ~ 11, but not limited to).
Setseconds () Sets the value of the seconds section in the Date object (0 ~ 59, but not limited to).
SetTime () Sets the date object with a millisecond Value.
SetUTCDate () Sets the value (1 ~ 31, but not limited to) of the Date Object section based on UTC Time.
setUTCFullYear () Sets the actual numeric value for the year part of the Date object based on UTC Time.
setUTCHours () Sets the value of the hour portion of the Date object based on UTC time (0 ~ 23, but not limited to).
setUTCMilliseconds () Sets the value of the "milliseconds" portion of the Date object based on UTC time (0 ~ 999, but not limited to).
setUTCMinutes () Sets the value of the "minutes" portion of the Date object based on UTC time (0 ~ 59, but not limited to).
setUTCMonth () Sets the value of the month portion of the Date object based on UTC time (0 ~ 11, but not limited to).
setUTCSeconds () Sets the value of the "seconds" portion of the Date object based on UTC time (0 ~ 59, but not limited to).
Setyear () Obsolete please use the setFullYear () method Instead.
toDateString () Returns the string form of the Date object part (month day).
toGMTString () Obsolete please use the toutcstring () method Instead.
toLocaleDateString () Returns the string form of the date object in the Dates section (month and day), based on the local time format.
toLocaleString () Returns the string form of a Date object based on the local time format.
toLocaleTimeString () Returns the string form of the date Object's time section (time and seconds), based on the local time format.
ToString () Returns the string form of a date object.
toTimeString () Returns the string form of the Date Object "time" section (time and seconds).
toUTCString () Returns the string form of the date object, based on the UTC time Format.
UTC () The static function returns the number of milliseconds between the specified date and midnight of January 1, 1997 utc, based on the UTC Time.
ValueOf () Returns the original value of the date Object.

Javascript-date Object

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.