Save date of birth of user without timezone

I think I worked out what is going on. The date you have specified is within your daylight savings period so the the hour is subtracted to create UTC forcing your date to be on the previous day. The fix is to specify the UTC date. e.g. :

> new Date("1977-04-01T00:00:00Z")
1977-04-01T00:00:00.000Z
> new Date("1977-04-01T00:00:00")
1977-03-31T23:00:00.000Z
>

The first date is reported correctly. The second date is shifted as it uses daylight savings time.

4 Likes