Created
March 24, 2018 03:17
-
-
Save p0rsche/19955fd11470694a2a11da7b8e3c5246 to your computer and use it in GitHub Desktop.
Get time in format "mm:hh am|pm"
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
const timeLocale = 'en-GB' | |
const timeZone = 'UTC' | |
const time = (new Date()).toLocaleString(timeLocale, { timeZone: timeZone, hour: 'numeric', minute: 'numeric', hour12: true }) | |
// 10:10 am |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment