Can someone, please, explain this type of format in javascript
T00:00:00.000Z
And how to parse it?
i suggest you use moment.js
for this. In moment.js you can:
var localTime = moment().format('YYYY-MM-DD'); // store localTime
var proposedDate = localTime + "T00:00:00.000Z";
now that you have the right format for a time, parse it if it's valid:
var isValidDate = moment(proposedDate).isValid();
// returns true if valid and false if it is not.
and to get time parts you can do something like:
var momentDate = moment(proposedDate)
var hour = momentDate.hours();
var minutes = momentDate.minutes();
var seconds = momentDate.seconds();
// or you can use `.format`:
console.log(momentDate.format("YYYY-MM-DD hh:mm:ss A Z"));
More info about momentjs http://momentjs.com/