search

Home  >  Q&A  >  body text

javascript - Datatabe combined with ajax dynamically add data, there is a time summary, how to convert it into date

What is returned in the background in the red circle is a time frame. How to convert it to year, month, day type?"

伊谢尔伦伊谢尔伦2882 days ago469

reply all(2)I'll reply

  • PHP中文网

    PHP中文网2017-05-19 10:20:05

    Use moment.js to convert time into the format you want

    reply
    0
  • 迷茫

    迷茫2017-05-19 10:20:05

    The number above is the timestamp.

    new Date(timestamp) can construct the timestamp into a Date object

    Use the Date method to complete 年月日string conversion

    reply
    0
  • Cancelreply