해나아부지 개발일지

날짜 시간 얻기(get date format) javascript 본문

Developers/JavaScript

날짜 시간 얻기(get date format) javascript

__APPA 2020. 6. 11. 23:28
let date = new Date();

- Methods

getFullYear() - Returns the 4-digit year
getMonth() - Returns a zero-based integer (0-11) representing the month of the year.
getDate() - Returns the day of the month (1-31).
getDay() - Returns the day of the week (0-6). 0 is Sunday, 6 is Saturday.
getHours() - Returns the hour of the day (0-23).
getMinutes() - Returns the minute (0-59).
getSeconds() - Returns the second (0-59).
getMilliseconds() - Returns the milliseconds (0-999).
getTimezoneOffset() - Returns the number of minutes between the machine local time and UTC.

 

 

 

 

 

 

Comments