Search code examples
dateextjsinternet-explorer-8utc

converting a utc format date string to date object in Extjs


I have a date string in the format "2013-01-31T10:10:05.000Z". I want to convert this string to a Date object in extjs.

I have tried to use Ext.Date.parse("2013-01-31T10:10:05.000Z","Y-m-dTH:i:s.uZ"). But it is returning undefined.

I also tried with new Date("2013-01-31T10:10:05.000Z"), but it is also returning undefined.

Note: I have tried in IE8 browser.

Could anyone please help me to convert the above date string to Date object?

Thanks a lot sra. Now I am getting the result as ...UTC+5:30... Is there any way to convert this in IST format?


Solution

  • Try Ext.Date.parse("2013-01-31T10:10:05.000Z","c");

    The c is the format type for ISO 8601 formatted dates

    See the Ext.Date API for more details on this or other available formats