parseISO in date-fns showing the incorrect date

Viewed 12

I'm attempting to understand what exactly date-fns is doing when using parseISO() as it seems to be adding 2 hours to the time that I have saved in the database. The data is as follows:

ISO Date/Time saved in database: 2022-09-20T19:52:53.000Z

Using format(parseISO(2022-09-20T19:52:53.000Z), "HH:mm:ss") I get this: 21:52:53 hrs

Somewhere along the line 2 hours are being added and unsure as to the cause. A comment left by Monash Joshi in (stackoverflow issue) hints towards an explanation but not really a solution. Want I want to show is just the parsed date/time value as it is. Would it thus make sense to manipulate the string that I receive from the database myself?

Thanks in advance for your help! And let me know if you need any further information.

0 Answers
Related