Get DateTime formate from Retrieved stringDateAttribute Using Odata Java Script:
Some times you may get date time value as milli seconds in the below format as “/Date(1371723451000)/”
var RetrievedDate = ”/Date(1371723451000)/”;
to convert this into normal date you need to pass “RetrievedDate” string to the below highlited area.
var DateValue = new Date(parseInt(RetrievedDate.replace(“/Date(“, “”).replace(“)/”, “”), 10));
Now you will get DateValue in UTC date time format.
Cheers,
BY Vivek
No comments:
Post a Comment