Convert SharePoint Date to Readable date format using jquery

Hi friends, today we are going to see how to convert SharePoint date into human readable date format using jquery.

When you use REST API or JSOM to retrieve the date field from SharePoint, you will get the output as /Date(1508371200000)/. But what if you need it in a readable format?

We can easily convert above date format into a human-readable format using below script. Here

var rawDate = "/Date(1508371200000)/"; 
var rawDate = parseInt(rawDate.substring(6, 19)); 
var d = new Date(rawDate); 
var result = d.format("dd MMM yyyy");

In the above code, the variable result will give you the output as 19 Oct 2017

Convert SharePoint date to Readable date
Convert SharePoint date to Readable date

Recommended articles:

  1. CRUD Operations using REST API in SharePoint
  2. SharePoint Interview Questions
  3. SharePoint Content Types – Best Explained
  4. How to Make Conditionally Mandatory Field in SharePoint 2013
  5. SharePoint Site Columns – Best Explained

I hope you liked this article. Please feel free to ask your queries in the comment section below. Like our facebook page, and subscribe to our newsletter for future updates. Have a nice day!