728x90
반응형
new Date()
new Date(date string)
new Date(year,month)
new Date(year,month,day)
new Date(year,month,day,hours)
new Date(year,month,day,hours,minutes)
new Date(year,month,day,hours,minutes,seconds)
new Date(year,month,day,hours,minutes,seconds,ms)
new Date(milliseconds)
Date Input
ISO Date | "2015-03-25" (The International Standard) |
Short Date | "03/25/2015" |
Long Date | "Mar 25 2015" or "25 Mar 2015" |
Date Input - Parsing Dates
Date.parse() : If you have a valid date string, you can use the method to convert it to milliseconds.
Date Get Methods
getFullYear() | Get year as a four digit number (yyyy) |
getMonth() | Get month as a number (0-11) |
getDate() | Get day as a number (1-31) |
getDay() | Get weekday as a number (0-6) |
getHours() | Get hour (0-23) |
getMinutes() | Get minute (0-59) |
getSeconds() | Get second (0-59) |
getMilliseconds() | Get millisecond (0-999) |
getTime() | Get time (milliseconds since January 1, 1970) |
Set Date Methods
MethodDescription
setDate() | Set the day as a number (1-31) |
setFullYear() | Set the year (optionally month and day) |
setHours() | Set the hour (0-23) |
setMilliseconds() | Set the milliseconds (0-999) |
setMinutes() | Set the minutes (0-59) |
setMonth() | Set the month (0-11) |
setSeconds() | Set the seconds (0-59) |
setTime() | Set the time (milliseconds since January 1, 1970) |
728x90
반응형
'JAVASCRIPT' 카테고리의 다른 글
20241122_3 Comparison (4) | 2024.11.22 |
---|---|
20241122_2 Math Object (0) | 2024.11.22 |
20241121_2 Arrays (0) | 2024.11.21 |
20241121_1 Numbers (2) | 2024.11.21 |
20241120_ String (Methods,Templates) (0) | 2024.11.20 |