Skip to main content

Posts

Showing posts with the label json datetime format in javascript

json datetime format in javascript

function formatJSONDate(jsonDate) {     //2014-09-05T00:00:00     var today = new Date(jsonDate);     var date = today.getDate();     var month = today.getMonth() + 1; //January is 0. so we add + 1;     if (date < 10) {         date = '0' + date     }     if (month < 10) {         month = '0' + month     }     var today = date + FormatMonth(month);     return today; } function FormatMonth(jsonMonth) {     var month = '' ;     switch (jsonMonth) {         case "01" :             month = "Jan" ;             break ;    ...