Convert HR.Net date to JS-format

Convert HRNET string with date into JS date format

function getLocalizedDate(sDateStr) 

{

      var oDate = new Date();

      //Parse the date according to your string

       var oDateARR = sDateStr.split("/");

       oDate.setDate(oDateARR[0]);

       oDate.setMonth(oDateARR[1]-1,oDateARR[0]);

       oDate.setFullYear(oDateARR[2]);

       return oDate;

}

This entry was posted in Uncategorized and tagged , , , . Bookmark the permalink.

Leave a Reply

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