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
- CRUD Operations using REST API in SharePoint
- SharePoint Interview Questions
- SharePoint Content Types – Best Explained
- How to Make Conditionally Mandatory Field in SharePoint 2013
- 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!