How to convert a DateTime value to dd/mm/yyyy in jQuery?

前端 未结 3 1916
陌清茗
陌清茗 2021-01-16 04:57

I am having a datetime object whose value is: /Date(1475173800000)/ in jQuery. I want it to be displayed in dd/mm/yyyy in jQuery. Is there

3条回答
  •  伪装坚强ぢ
    2021-01-16 05:34

    Try jQuery dateFormat for easy and flexible date formatting. You simply use it like this:

    var timestamp = /\/Date\((.*)\)\//;
    var myDate = new Date(parseInt(timestamp));
    $.format.date(myDate.getTime(), "dd/mm/yyyy"));
    

提交回复
热议问题