Created
October 2, 2018 21:20
-
-
Save minedun6/0d264fbc332e2416c8ff40f5f24dc1bb to your computer and use it in GitHub Desktop.
Localized date
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// list of timezone | |
// https://gist.github.com/rxaviers/8481876 | |
let nhr = new Date().toLocaleTimeString('en', { | |
year: 'numeric', | |
month: '2-digit', | |
day: '2-digit', | |
hour: '2-digit', | |
minute: '2-digit', | |
hour12: false, | |
timeZone: 'Africa/Tunis' | |
}); | |
alert(nhr); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment