Skip to content

Instantly share code, notes, and snippets.

@robnyman
Created February 13, 2012 23:55
Show Gist options
  • Save robnyman/1821580 to your computer and use it in GitHub Desktop.
Save robnyman/1821580 to your computer and use it in GitHub Desktop.
Serializing dates with JSON
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);
@robnyman
Copy link
Author

I understand. Well, you need to assess what you need to do and what works best for you.
Good luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment