0

They're pretty stored in the database.

But when i take it from the node and sprinkle it into json, it changes into this format.

YY-mm-dd HH:ii:ss -> YY-mm-ddThh:ii:ss,000Z,

Why does it happen and How can i fix it?

Abhishek kumar
  • 4,347
  • 8
  • 29
  • 44
  • It happens because it is converted to Javascript's native Date and then to string in the JSON. You can manually change the format using a library like moment. – Abhyudit Jain Feb 08 '18 at 07:03

1 Answers1

2

It is getting converted to a date object and when you stringify the javascript object it will call the date.toISOString() format, take a look at this: Node.js - How to format a date string in UTC

If you post some code we can help you.

Ali
  • 21
  • 1