JS에서 시간 출력

1
실질적으로
Intl.DateTimeFormat()
를 동작한다.

# ko

(new Date()).toLocaleString(['ko'],{dateStyle:'full',timeStyle:'full',hourCycle:'h24'})
=> '2024년 12월 16일 월요일 14시 19분 38초 한국 표준시'

(new Date()).toLocaleString(['ko'],{dateStyle:'medium',timeStyle:'medium',hourCycle:'h24'})
=> '2024. 12. 16. 14:18:06'

(new Date()).toLocaleString(['ko'],{dateStyle:'long',timeStyle:'long',hourCycle:'h24'})
=> '2024년 12월 16일 14시 19분 4초 GMT+9'

(new Date()).toLocaleString(['ko'],{dateStyle:'short',timeStyle:'short',hourCycle:'h24'})
=> '24. 12. 16. 14:19'

# en

(new Date()).toLocaleString(['en'],{dateStyle:'full',timeStyle:'full',hourCycle:'h24'})
=> 'Monday, December 16, 2024 at 14:23:51 Korean Standard Time'

(new Date()).toLocaleString(['en'],{dateStyle:'long',timeStyle:'long',hourCycle:'h24'})
=> 'December 16, 2024 at 14:24:10 GMT+9'

(new Date()).toLocaleString(['en'],{dateStyle:'medium',timeStyle:'medium',hourCycle:'h24'})
=> 'Dec 16, 2024, 14:24:21'

(new Date()).toLocaleString(['en'],{dateStyle:'short',timeStyle:'short',hourCycle:'h24'})
=>'12/16/24, 14:24'
댓글
  • No Nickname
    No Comment
  • 권한이 없습니다.
    {{m_row.m_nick}}
    -
목록형 📷 갤러리형
제목
[기본형] HTML (with 부트스트랩5.3 , jquery 3.7, vue.js)
유용한 리눅스(LINUX) 명령어
[공지] 기술 게시판
2.1
2.2
2.3
2.4
2.5
2.6
2.7
2.8
2.9
2.10
2.11
2.12
2.13
2.14
2.15
2.16
2.17
2.18
2.19
2.20
2.21
2.22
2.23
2.24
2.25
2.26
2.27
2.28