from unix timestamp to datetime

前端 未结 8 1017
日久生厌
日久生厌 2020-12-01 09:28

I have something like /Date(1370001284000+0200)/ as timestamp. I guess it is a unix date, isn\'t it? How can I convert this to a date like this: 31.05.201

8条回答
  •  庸人自扰
    2020-12-01 09:44

    I would like to add that Using the library momentjs in javascript you can have the whole data information in an object with:

    const today = moment(1557697070824.94).toObject();
    

    You should obtain an object with this properties:

    today: {
      date: 15,
      hours: 2,
      milliseconds: 207,
      minutes: 31,
      months: 4
      seconds: 22,
      years: 2019
    }
    

    It is very useful when you have to calculate dates.

提交回复
热议问题