Created
February 13, 2012 23:55
-
-
Save robnyman/1821580 to your computer and use it in GitHub Desktop.
Serializing dates with JSON
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var date = new Date(); | |
console.log(date); | |
var dateAsString = JSON.stringify(date); | |
console.log(dateAsString); | |
var dateAsObj = new Date(JSON.parse(dateAsString)); | |
console.log(dateAsObj); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I understand. Well, you need to assess what you need to do and what works best for you.
Good luck!