Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Javascript date to xs:dateTime

Is there a simple way to convert standard Javascript date format to xs:dateTime

So I have a date value (new Date()) and I need in the format: 2015-01-16T20:26:53.974+03:00

so

Fri Jan 16 2015 22:26:53 GMT+0500 (Ekaterinburg Standard Time) -> 2015-01-16T20:26:53.974+03:00

It strange but cound't find simple solution.

like image 411
WHITECOLOR Avatar asked Jan 16 '15 18:01

WHITECOLOR


Video Answer


1 Answers

I believe this is the same as the ISO date format

var date = new Date();
var formatted = date.toISOString();
like image 169
ctregan Avatar answered Sep 27 '22 20:09

ctregan