how to convert date without timezone?
data from the backend comes in the format
1701699255
I'm trying to execute code like this
new Date((1701699255 * 1000) - new Date().getTimezoneOffset() * 60000)
but it still gives me data in timezone format. How can I do it correctly?
As far as I understood your requirement; you want to convert the timestamp to a date string without timezone, for which you can use the
toISOString()method and then remove the timezone information from the resulting string.Another approach is to use
getUTC*methods in case you want to keep theDateobject and display it without timezone.