Conversion

Chaîne en objet date (string to Date Object)


var s = ''1996-04-18T00:00:00.0000000';
var t = s.replace(/[:T.-]/g,';').split(';');
t[1]=+t[1]-1;
var r = new (Date.bind.apply(Date,[null].concat(t)))();

// bind.apply hack found on http://stackoverflow.com/questions/3362471/how-can-i-call-a-javascript-constructor-using-call-or-apply
// instead of  var r = new Date(t[0],t[1],t[2],t[3],t[4],t[5],t[6]);

Format x en ISO:

#dd-MM-yyyy HH:mm:ss#".replace(/#(..)-(..)-(....) (.*)#/,"$3-$2-$1T$4Z")