.format adds 1 hour to time I pass it #3440
Unanswered
danielmsrodrigues
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm using node js and am trying to make a reservation system.
I'm using prisma to work on my database and prisma's default datetime format is YYYY-MM-DDTHH:mm:ss.000Z.
I'm passing the datetime as 2023-06-06T12:00:00.000Z and it is being stored correctly on my database. However, I'm trying to send confirmation and cancelation emails to each user creating or removing a reservation and I don't want to send an email saying "Reservation for 2023-06-06T12:00:00.000Z confirmed".
For that reason, I tried using date-fns and created a variable:
When I console log this formattedReservationHour or received the email, for some reason date-fns is adding 1 hour to the time I pass it (instead of 12:00, it turns into 13:00). How can I fix this?
Please let me know if you can help in some way.
Beta Was this translation helpful? Give feedback.
All reactions