Adds value to this date by millisecond | second | minute | hour | day | week | month | year
Returns a new Date object that is an exact date and time copy of the original instance.
A new Date instance
Returns the number of milliseconds between this date and date.
Defaults to now
The diff in milliseconds
Compares this instance to another Date object and returns true if they are equal.
Date object to compare. If no date to compare, new Date() [now] is used.
true if dates are equal. false if they are not equal.
Converts the value of the current Date object to its equivalent string representation.
Format Specifiers:
https://www.w3.org/TR/NOTE-datetime https://www.ietf.org/rfc/rfc3339.txt
Formats:
Format Description Example ------ ------------------------------------------------------- ---------------- s The seconds of the minute between 0-59. "0" to "59" ss The seconds of the minute with leading zero if required. "00" to "59" m The minute of the hour between 0-59. "0" or "59" mm The minute of the hour with leading zero if required. "00" or "59" h The hour of the day between 1-12. "1" to "12" hh The hour of the day with leading zero if required. "01" to "12" H The hour of the day between 0-23. "0" to "23" HH The hour of the day with leading zero if required. "00" to "23" ddd Abbreviated week day name. "Mon" to "Sun" dddd The full week day name. "Monday" to "Sunday" D The day of the month between 1 and 31. "1" to "31" DD The day of the month with leading zero if required. "01" to "31" M The month of the year between 1-12. "1" to "12" MM The month of the year with leading zero if required. "01" to "12" MMM Abbreviated month name. "Jan" to "Dec" MMMM The full month name. "January" to "December" YY The year as a two-digit number. "99" or "08" YYYY The full four digit year. "1999" or "2008" A AM or PM "AM" or "PM"
A format string. The default value is: 'YYYY-MM-DD HH:mm:ss'.
A local string like {language}-{country}.
A string representation of the current Date object.
Get the timezone offset string of the date.
The 4-character offset string prefixed with + or - (e.g. "-0500")
1~53
Determines if this date occurs after the date to compare to.
Date object to compare. If no date to compare, new Date() ("now") is used.
true if this date instance is greater than the date to compare to (or "now"), otherwise false.
Determines if this date occurs before the date to compare to.
Date object to compare. If no date to compare, new Date() ("now") is used.
true if this date instance is less than the date to compare to (or "now").
if this date instance is 'today', otherwise false.
Sets new value to this date on millisecond | second | minute | hour | day | week | month | year | timezoneOffset
Resets the time of this Date object to 23:59:59:999, which is the end of the day.
this
Resets the time of this Date object to the current time ('now').
this
Sets new timezone offset(Minutes) to this date.
Moves the date to the week set. Week one (1) is the week which contains the first day of the year.
A Number (1 to 53) that represents the week of the year.
0 is Sunday, Defaults is 1.
this
Resets the time of this Date object to 00:00:00:000, which is the start of the day.
this
Add some helpful methods for Date.prototype