Created
November 30, 2020 09:28
-
-
Save Harrisonkamau/9089cf8d578b9ca29539548d2bc5ecf4 to your computer and use it in GitHub Desktop.
Only render HH:MM AM/PM timestamp using JS
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 date = new Date(); | |
date.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' }); // E.g. 12:30 PM |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment