Help with formatISO #2366
Answered
by
devuxer
laurensiusadi
asked this question in
Q&A
Help with formatISO
#2366
-
|
I'm trying to use But instead I'm getting How do I get the format like in the docs? |
Beta Was this translation helpful? Give feedback.
Answered by
devuxer
Mar 25, 2021
Replies: 1 comment 3 replies
-
const result = new Date(2019, 8, 18, 19, 0, 52).toISOString();
// "2019-09-18T19:00:52.000Z"
const result = format(new Date(2019, 8, 18, 19, 0, 52), "yyyy-MM-dd'T'HH:mm:ss'z'")
// "2019-09-18T19:00:52z"
|
Beta Was this translation helpful? Give feedback.
3 replies
Answer selected by
laurensiusadi
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment


toISOString(), though it's not exactly the same as the date-fns docs.