How to display a DB UTC date without it being converted to local time

Hi @patrick,

I have a database date “2021-10-19T12:08:35.000Z” which comes through to the browser unchanged. I then apply formatDate(‘dd-MMM-yyyy HH:mm’) to format the date and it appears on the page as “19-Oct-2021 13:08”. So it looks like the formatDate function converts it to local time which for that date is UTC+1.

I want to display the UTC date, i.e. “19-Oct-2021 12:08”, so how do I format it without it being converted to local time?

Thanks
Allan

Community Page
Last updated: