Get DateTime formate from Retrieved stringDateAttribute Using Odata Java Script – MS CRM 2011

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,

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s