Answer the question
In order to leave comments, you need to log in
Why are dates different in node.js and browser?
I use nuxt.js with ssr. I have authorization, after successful authorization cookies are set.
The date for expires comes in this format 2020-01-20 19:09:46 +03:00
For cookies on the server and client 1, the format of the options is:
{
expires: new Date(expireAt),
}
2020-01-20T16:05:40.000Z
Mon Jan 20 2020 19:09:46 GMT+0300 (Москва, стандартное время)
Answer the question
In order to leave comments, you need to log in
These are 2 identical dates in different formats. You can see for yourself
console.log(new Date ('Mon Jan 20 2020 19:09:46 GMT+0300').getTime() == new Date('2020-01-20T16:05:40.000Z').getTime());
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question