Replies: 1 comment
-
You need to change Something to consider, the import { parse, parseISO } from "date-fns";
const dateString = "2020-10-29T06:37:57.045Z";
const result1 = parse(dateString, "yyyy-MM-dd'T'HH:mm:ss.SSSX", new Date());
const result2 = new Date(dateString);
const result3 = parseISO(dateString);
console.log(result1); // Thu Oct 29 2020 02:37:57 GMT-0400 (Eastern Daylight Time)
console.log(result2); // Thu Oct 29 2020 02:37:57 GMT-0400 (Eastern Daylight Time)
console.log(result3); // Thu Oct 29 2020 02:37:57 GMT-0400 (Eastern Daylight Time) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
i wanted parse to give same output as new Date() is giving.
am i doing something wrong here ??
Beta Was this translation helpful? Give feedback.
All reactions