Created
July 1, 2022 15:53
-
-
Save miroswd/0214791f695a6226d8a789c60f5e399c to your computer and use it in GitHub Desktop.
Format date natively with 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("2022-01-31 00:00"); | |
const actual = new Intl.DateTimeFormat("pt-br", { | |
dateStyle: "full", | |
timeStyle: "long", | |
}).format(date); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment