Skip to content

Instantly share code, notes, and snippets.

@miroswd
Created July 1, 2022 15:53
Show Gist options
  • Save miroswd/0214791f695a6226d8a789c60f5e399c to your computer and use it in GitHub Desktop.
Save miroswd/0214791f695a6226d8a789c60f5e399c to your computer and use it in GitHub Desktop.
Format date natively with JS
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