Created
July 12, 2020 11:02
-
-
Save Momciloo/fd3f7f1391958936b9e9ba8355cdff01 to your computer and use it in GitHub Desktop.
Date string to human-readable format
This file contains 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 dateString = '2020-05-14T04:00:00Z' | |
const formatDate = (dateString) => { | |
const options = { year: "numeric", month: "long", day: "numeric" } | |
return new Date(dateString).toLocaleDateString(undefined, options) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment