Replies: 2 comments
-
They are the same day in your local timezone, which is what // in node.js
process.env.TZ = 'Europe/Helsinki';
import { isSameDay, parseISO } from 'date-fns';
const startTime = parseISO('2022-10-25T21:43:00.000Z');
const endTime = parseISO('2022-10-26T06:43:00.000Z');
console.log(startTime.toString()); // Wed Oct 26 2022 00:43:00 GMT+0300 (Eastern European Summer Time)
console.log(endTime.toString()); // Wed Oct 26 2022 09:43:00 GMT+0300 (Eastern European Summer Time)
console.log(isSameDay(startTime, endTime)); // true |
Beta Was this translation helpful? Give feedback.
0 replies
-
|
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 am kind of confused about the result of this following code
it prints:
The start time is at
2022-10-25T21:43:00.000Z
UTC and endTime is at2022-10-26T06:43:00.000Z
UTC. They are different days butisSameDay
returnstrue
. Does anyone know if i do anything wrong?My time zone is Finland, UTC+3
Thank you.
Beta Was this translation helpful? Give feedback.
All reactions