In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article mainly introduces the relevant knowledge of "how to operate date objects in javascript". The editor shows you the operation process through actual cases. The method of operation is simple and fast, and it is practical. I hope this article "how to operate date objects in javascript" can help you solve the problem.
Methods for date objects: getDate (), getDay (), getFullYear (), getHours (), getMinutes (), getMonth (), getSeconds (), getTime (), parse (), setDate (), and so on.
The Date object is used to process dates and times.
The method of date object in javascript
The method describes that getDate () returns a day of the month (1-31) from the Date object. GetDay () returns the day of the week (0-6) from the Date object. GetFullYear () returns the year in four digits from the Date object. GetHours () returns the hours of the Date object (0-23). GetMilliseconds () returns the milliseconds (0-999) of the Date object. GetMinutes () returns the minutes of the Date object (0-59). GetMonth () returns the month (0-11) from the Date object. GetSeconds () returns the number of seconds of the Date object (0-59). GetTime () returns the number of milliseconds since January 1, 1970. GetTimezoneOffset () returns the minute difference between local time and Greenwich mean time (GMT). GetUTCDate () returns the day of the month (1-31) from the Date object based on UTC. GetUTCDay () returns the day of the week (0-6) from the Date object based on UTC. GetUTCFullYear () returns a four-digit year from the Date object based on UTC. GetUTCHours () returns the hours (0-23) of the Date object based on UTC. GetUTCMilliseconds () returns the milliseconds (0-999) of the Date object based on UTC. GetUTCMinutes () returns the minutes (0-59) of the Date object based on UTC. GetUTCMonth () returns the month (0-11) from the Date object based on UTC. GetUTCSeconds () returns the seconds of the Date object based on UTC (0-59). GetYear () is obsolete. Use the getFullYear () method instead. Parse () returns the number of milliseconds from midnight on January 1, 1970 to the specified date (string). SetDate () sets the day of the month in the Date object (1-31). SetFullYear () sets the year (four digits) in the Date object. SetHours () sets the hour (0-23) in the Date object. SetMilliseconds () sets the milliseconds (0-999) in the Date object. SetMinutes () sets the minutes in the Date object (0-59). SetMonth () sets the month in the Date object (0-11). SetSeconds () sets the seconds in the Date object (0-59). The setTime () setTime () method sets the Date object in milliseconds. SetUTCDate () sets the day of the month in the Date object (1-31) based on UTC. SetUTCFullYear () sets the year (four digits) in the Date object based on UTC. SetUTCHours () sets the hour (0-23) in the Date object based on UTC. SetUTCMilliseconds () sets the milliseconds (0-999) in the Date object based on UTC. SetUTCMinutes () sets the minutes (0-59) in the Date object based on universal time. SetUTCMonth () sets the month (0-11) in the Date object based on UTC. The setUTCSeconds () setUTCSeconds () method is used to set the seconds field for a specified time based on Universal time (UTC). SetYear () is obsolete. Use the setFullYear () method instead. ToDateString () converts the date portion of the Date object to a string. ToGMTString () is obsolete. Use the toUTCString () method instead. ToISOString () returns the date format of the string using the ISO standard. ToJSON () returns the date string in JSON data format. ToLocaleDateString () converts the date portion of the Date object to a string based on the local time format. ToLocaleTimeString () converts the time portion of the Date object to a string based on the local time format. ToLocaleString () converts the Date object to a string based on the local time format. ToString () converts the Date object to a string. ToTimeString () converts the time portion of the Date object to a string. ToUTCString ()
Converts the Date object to a string based on universal time.
Example:
Var today = new Date (); var UTCstring = today.toUTCString (); UTC () returns the number of milliseconds from January 1, 1970 to the specified date, based on UTC. ValueOf () returns the original value of the Date object. This is the end of the introduction to "how to manipulate date objects in javascript". Thank you for reading. If you want to know more about the industry, you can follow the industry information channel. The editor will update different knowledge points for you every day.
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.