ECMAScript

[ECMAScript] Date

nineDeveloper 2018. 2. 27. 17:33
728x90
반응형

https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Date/prototype

 

Date.prototype.getMilliseconds()

> 0~999
 

Date.prototype.getSeconds()

> 0~59


Date.prototype.getMinutes()

> 0~59


Date.prototype.getHours()

> 0~23


Date.prototype.getDate()

> 1~31


Date.prototype.getMonth()

> 0~11


Date.prototype.getFullYear()

> YYYY


Date.prototype.getDay()

> 0~6


Date.prototype.getTime()

> TIMESTAMP January 1, 1970, 00:00:00 UTC



세계 기준시간 검사

new Date(1970,1,1,0,0,0)
new Date().getTimezoneOffset()
new Date(0).getHours(), 
new Date(0).getMinutes()


시각추출
TIMESTAMP % 1000           //밀리초
( TIMESTAMP % (24*60*60) ) //3600 : 현재 시각 Hour +00:00
( TIMESTAMP % (60*60) )     //60 : 현재 시각 Minute
( TIMESTAMP % 60 )         //현재 시각 Second


728x90
반응형