MySQL Forums
Forum List  »  Connector/Node.js

Re: Dates being returned in the wrong timezone
Posted by: Lawrence Marigold
Date: November 26, 2020 03:27AM

Hi,

In that case I would seem to be stuck with either having the date out by an hour in the code, or seeing UTC dates when I do a query using the mysql client or workbench - or am I wrong about that?

I just tried using a timestamp column instead of datetime and strangely it's still adding an hour! The timestamp I get from workbench when I do

select max(updatedOn) from products

is 1606137696

In the javascript however with exactly the same code I get the js timestamp of 1606141296000, which divided by 1000 for the difference between js and unix timestamps is an hour later. It seems very odd that it actually changes the timestamp, as that should always be the same no matter the timezone?

Thanks - Lawrence

Options: ReplyQuote




Sorry, only registered users may post in this forum.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.