DEV Community

Discussion on: What can cause `new Date()` to return incorrect dates?

Collapse
 
gdsoumya profile image
Soumya Ghosh Dastidar

I don't exactly know what's wrong with your code without seeing it completely. Just some tips :

  1. Always set the Date on the server and not from the client side.
  2. Use unix timestamp for easier calculations, they can be easily converted to any date-time format.
Collapse
 
nisajthani profile image
Nisa JThani

Thank you for your reply.

  1. The Date is already set on my Node.js LoopBack 4 server
  2. I haven't tried this method. I will do this next. Thanks.