How do I convert a string like this back to a date object?
"Thu Aug 18 2011 15:13:55 GMT-0400 (Eastern Daylight Time)"
Is there a more native way to store dates in javascript?
I've tested this in IE7, IE8, IE9, chrome, and firefox 6:
new Date('Thu Aug 18 2011 15:13:55 GMT-0400 (Eastern Daylight Time)');
and it works.
http://www.w3schools.com/jsref/jsref_obj_date.asp provides some insight, just package it up and send it through and youll find all sorts of conveniance provided.
var d = new Date(year, month, day, hours, minutes, seconds, milliseconds);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With