I pick some date and time in javascript and then want to store it on server (.NET). Dates are supposed to be in future from the current moment (so they won't be before 1970).
Having read topics here on SO I learnt it's better to store date as a string and people suggest using Date.prototype.toISOString()
or Date.prototype.toUTCString()
.
I've read that toISOString()
is not available in IE 7. And I'd like to know other differences, when I should choose one or another function.
They're for different purposes.
ms
in its format.So if you want to send data to the server, send the ISO
, because ISO
is the standard format:
var date = new Date();
sendDate(date.toISOString());
You can also use toISOString
in IE7 polyfill.