Skip to content

Instantly share code, notes, and snippets.

@rurumimic
Created October 11, 2023 11:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rurumimic/9fd4f4769282b7125563e5a919cadd34 to your computer and use it in GitHub Desktop.
Save rurumimic/9fd4f4769282b7125563e5a919cadd34 to your computer and use it in GitHub Desktop.
javascript datetime
new Date().toUTCString()
new Date().toGMTString()
// 'Wed, 11 Oct 2023 11:54:48 GMT'
new Date().toLocaleString('ko-KR', {timeZone: 'Asia/Seoul', hour12: false, dateStyle: 'full', timeStyle: 'long'})
// '2023. 10. 11. 수요일 20시 47분 27초 GMT+9'
new Date().toLocaleString('en-US', {timeZone: 'America/New_York', hour12: false, dateStyle: 'full', timeStyle: 'long'})
// 'Wednesday, October 11, 2023 at 07:48:56 EDT'
new Date().toLocaleString('en-GB', {timeZone: 'Europe/London', hour12: false, dateStyle: 'full', timeStyle: 'long'})
// 'Wednesday, 11 October 2023 at 12:54:19 BST'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment