In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-27 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces "what are the Date object methods of JavaScript". In the daily operation, I believe that many people have doubts about the Date object methods of JavaScript. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "what are the Date object methods of JavaScript?" Next, please follow the editor to study!
Article catalogue
The syntax for creating a Date object:
JavaScript Date object reference manual Date object
The Date object is used to process the date and time.
Syntax for creating a Date object: var myDate=new Date () Note: the Date object automatically saves the current date and time to its initial value.
Date object Properties
FF: Firefox, IE: Internet Explorer
Property describes that the FFIEconstructor returns a reference to the Date function that created this object. 14prototype gives you the ability to add properties and methods to objects. 14Date object method
FF: Firefox, IE: Internet Explorer
The method describes the date and time that FFIEDate () returns for the day. 13getDate () returns the day of the month (1-31) from the Date object. 13getDay () returns the day of the week (0-6) from the Date object. 13getMonth () returns the month (0-11) from the Date object. 13getFullYear () returns the year in four digits from the Date object. Use the getFullYear () method instead of 14getYear (). 13getHours () returns the hours of the Date object (0-23). 13getMinutes () returns the minutes of the Date object (0-59). 13getSeconds () returns the number of seconds of the Date object (0-59). 13getMilliseconds () returns the milliseconds (0-999) of the Date object. 14getTime () returns the number of milliseconds since January 1, 1970. 13getTimezoneOffset () returns the minute difference between local time and Greenwich mean time (GMT). 13getUTCDate () returns the day of the month (1-31) from the Date object based on UTC. 14getUTCDay () returns the day of the week (0-6) from the Date object based on UTC. 14getUTCMonth () returns the month (0-11) from the Date object based on UTC. 14getUTCFullYear () returns a four-digit year from the Date object based on UTC. 14getUTCHours () returns the hours (0-23) of the Date object based on UTC. 14getUTCMinutes () returns the minutes (0-59) of the Date object based on UTC. 14getUTCSeconds () returns the seconds of the Date object based on UTC (0-59). 14getUTCMilliseconds () returns the milliseconds (0-999) of the Date object based on UTC. 14parse () returns the number of milliseconds from midnight on January 1, 1970 to the specified date (string). 13setDate () sets the day of the month in the Date object (1-31). 13setMonth () sets the month in the Date object (0-11). 13setFullYear () sets the year (four digits) in the Date object. Use the setFullYear () method instead of 14setYear (). 13setHours () sets the hour (0-23) in the Date object. 13setMinutes () sets the minutes in the Date object (0-59). 13setSeconds () sets the seconds in the Date object (0-59). 13setMilliseconds () sets the milliseconds (0-999) in the Date object. 14setTime () sets the Date object in milliseconds. 13setUTCDate () sets the day of the month in the Date object (1-31) based on UTC. 14setUTCMonth () sets the month (0-11) in the Date object based on UTC. 14setUTCFullYear () sets the year (four digits) in the Date object based on UTC. 14setUTCHours () sets the hour (0-23) in the Date object based on UTC. 14setUTCMinutes () sets the minutes (0-59) in the Date object based on universal time. 14setUTCSeconds () sets the seconds in the Date object (0-59) based on UTC. 14setUTCMilliseconds () sets the milliseconds (0-999) in the Date object based on UTC. 14toSource () returns the source code for the object. 1-toString () converts the Date object to a string. 14toTimeString () converts the time portion of the Date object to a string. 14toDateString () converts the date portion of the Date object to a string. Use the toUTCString () method instead of 14toGMTString (). 13toUTCString () converts the Date object to a string based on universal time. 14toLocaleString () converts the Date object to a string based on the local time format. 13toLocaleTimeString () converts the time portion of the Date object to a string based on the local time format. 13toLocaleDateString () converts the date portion of the Date object to a string based on the local time format. 13UTC () returns the number of milliseconds from January 1, 1997 to the specified date, based on UTC. 13valueOf () returns the original value of the Date object. 14 at this point, the study on "what are the Date object methods of JavaScript" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.