0

I'm passing the data to back-end in date format -

Fri Nov 08 201900:00:00 GMT+0530 (India Standard Time) ,

but it was automatically converting the date format to this DateandTime format - 2019-11-07T18:30:00.000Z and in database its storing '2019-11-08'. while retrieving the data it's returning one day off '2019-11-07'.

לבני מלכה
  • 15,925
  • 2
  • 23
  • 47
Prasanth
  • 31
  • 2
  • which database you are using and what is timezone of your database? – Yogesh Katkar Nov 20 '19 at 07:53
  • MySQL Database and timezone of my Database is EST. – Prasanth Nov 20 '19 at 08:04
  • Angular converts your date time according to the local time zone Change your mysql time zone to UTC(co-ordinated universal time zone) and save your date again and check it. this will give you the correct output. hope this helps you – Yogesh Katkar Nov 20 '19 at 09:36
  • I had changed the Mysql database timezone to SET GLOBAL time_zone = '+00:00'; but still its storing one day off. While passing in the API, its working as expected date. I don't know what to do? – Prasanth Nov 26 '19 at 10:17

0 Answers0