Js obtains the summary of current date and time and other date operations.
The examples in this article share common scenarios of javascript time operations for your reference. The specific content is as follows:
Var myDate = new Date (); myDate.
This article mainly introduces the date and time objects of JavaScriptDate. For more information, see
Date and Time object
1. Introduction
Date object, which is the object that operates on the Date and time. The Date object can only operate on the
Recently by the date made a lot of headaches, because the month of JS is more special [0-11], so in the months of many difficult to calculate. Specially sorted out the date some methods.
First of all, the following code has a common date format
This article mainly introduces how to get the summary of current date and time and other date operations by js. Interested partners can refer to the examples in this article to share common scenarios of javascript time operations, for your reference,
Detailed description of the JavaScript Date object, javascriptdate
This article describes how to operate Date and Time objects.
Directory1. Introduction: Describes the Date object.
2. constructor: describes several methods of the constructor of the
This article for everyone to share JS get the current date time and format operation, the specific contents are as follows
var mydate = new Date ();
Mydate.getyear (); Gets the current year (2-bit)
mydate.getfullyear (); Get full year (4-
Examples of this article for you to share the use of JavaScript time operation of common scenarios for your reference, the specific contents are as follows
var mydate = new Date ();
Mydate.getyear (); Gets the current year (2-bit)
/**
* Get start date, end date for this week, quarter, month, month
*/
var now = new Date (); //Current date
var nowdayofweek = Now.getday (); //The day of the week today
var nowday = Now.getdate (); //Current day
var nowmonth =
JS get current date time and other operation summary
var mydate = new Date ();
Mydate.getyear (); Gets the current year (2-bit)
mydate.getfullyear (); Get full year (4-bit, 1970-????)
Mydate.getmonth (); Get the current month (0-11, 0 for
JS get current date time and other operation summary
1 2 3 4 5 6 7 8 9 10 11 12 13-14
var mydate = new Date (); Mydate.getyear (); Gets the current year (2-bit) mydate.getfullyear (); Get the complete year (4-bit, 1970-????)
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.