1
> new Date().toJSON() =  "2013-11-21T03:58:17.178Z"

>new Date() = Wed Nov 20 2013 19:58:20 GMT-0800 (PST)

Why changing the representation changes the date format?

Nadeem_MK
  • 7,533
  • 7
  • 50
  • 61
daydreamer
  • 87,243
  • 191
  • 450
  • 722

1 Answers1

1

JSON dates have the same format as the ISO-8601 standard, which is by default expressed in UTC (Coordinated Universal Time), and Date() is expressed as your local time.

coderLMN
  • 3,076
  • 1
  • 21
  • 26