Convert json date to date format in jQuery

7 Mar

In this post we will learn how to convert  Json date to date format in jQuery.

Example: /Date(1334514600000)/     ——————————–> dd/mm/yyy



var dateString = "\/Date(1334514600000)\/".substr(6);
var currentTime = new Date(parseInt(dateString ));
var month = currentTime.getMonth() + 1;
var day = currentTime.getDate();
var year = currentTime.getFullYear();
var date = day + "/" + month + "/" + year;
You can test this in JsFiddle

Place the above code in JsFiddle and type Run

8 thoughts on “Convert json date to date format in jQuery

Leave a Reply

Your email address will not be published. Required fields are marked *