In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-23 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/03 Report--
This article will explain in detail how the object profile of JavaScript Date is, and the content of the article is of high quality, so the editor will share it for you as a reference. I hope you will have a certain understanding of the relevant knowledge after reading this article.
The Date object is used to process the date and time.
1. The syntax for creating a Date object:
Var myDate=new Date ()
2.Date object Properties
Constructor / / returns a reference to the Date function that created this object.
Prototype / / gives you the ability to add properties and methods to objects.
3.Date object method
Date () / / returns the date and time of the day.
GetDate () / / returns the day of the month (1-31) from the Date object.
GetDay () / / returns the day of the week (0-6) from the Date object.
GetMonth () / / returns the month (0-11) from the Date object.
GetFullYear () / / returns the year in four digits from the Date object.
GetYear () / / use the getFullYear () method instead.
GetHours () / / returns the hour of the Date object (0-23).
GetMinutes () / / returns the minutes of the Date object (0-59).
GetSeconds () / / returns the number of seconds of the Date object (0-59).
GetMilliseconds () / / returns the millisecond (0-999) of the Date object.
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 according to UTC.
GetUTCDay () / returns the day of the week (0-6) from the Date object according to UTC.
GetUTCMonth () / / returns the month (0-11) from the Date object based on UTC.
GetUTCFullYear () / / returns a four-digit year from the Date object based on UTC.
GetUTCHours () / / returns the hour (0-23) of the Date object based on UTC.
GetUTCMinutes () / / the minute in which the Date object is returned based on UTC (0-59)
GetUTCSeconds () / / returns the seconds of the Date object based on UTC (0-59).
GetUTCMilliseconds () / / returns the millisecond (0-999) of the Date object based on UTC.
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).
SetMonth () / / sets the month in the Date object (0-11).
SetFullYear () / / sets the year (four digits) in the Date object.
SetYear () / / use the setFullYear () method instead.
SetHours () / / sets the hour (0-23) in the Date object.
SetMinutes () / / sets the minutes in the Date object (0-59).
SetSeconds () / / sets the seconds in the Date object (0-59).
SetMilliseconds () / / sets the milliseconds (0-999) in the Date object.
SetTime () / / sets the Date object in milliseconds.
SetUTCDate () / / sets the day of the month in the Date object (1-31) according to UTC.
SetUTCMonth () / / sets the month (0-11) in the Date object according to UTC.
SetUTCFullYear () / / sets the year (four digits) in the Date object based on UTC.
SetUTCHours () / / sets the hour (0-23) in the Date object according to UTC.
SetUTCMinutes () / / sets the minutes in the Date object (0-59) according to UTC.
SetUTCSeconds () / / sets the seconds in the Date object (0-59) according to UTC.
SetUTCMilliseconds () / / sets the milliseconds (0-999) in the Date object according to UTC.
ToSource () / / returns the source code of the object.
ToString () / / converts the Date object to a string.
ToTimeString () / / converts the time portion of the Date object to a string.
ToDateString () / / converts the date portion of the Date object to a string.
ToGMTString () / / use the toUTCString () method instead.
ToUTCString () / converts the Date object to a string based on universal time.
ToLocaleString () / converts 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. ToLocaleDateString () / converts the date portion of the Date object to a string based on the local time format.
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.
On JavaScript Date object profile is how to share here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
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.