Home  >  Q&A  >  body text

Timestamp conversion

How to change the timestamp after refreshing the page to the current date

  1. Before refreshing the page, it was 2017/7/24 html/php: <?=date('Y-m-d h: i:s',$value['time']);?>

  2. After no refresh, the time becomes a timestamp js/html

  3. Using Ajax to execute str = "<td><a href='#' title='title'>" msg['row'][i]['time'] " </a></td><td>" msg['row'][i]['author'] "</td>";

小猪小猪2667 days ago1446

reply all(2)I'll reply

  • 立伟

    立伟2017-07-26 15:52:14

    After the operation is done in the background, just throw it to the front desk

    reply
    0
  • 小猪

    小猪2017-07-24 11:14:37

    Add picturesUQ)~3(P]1(SQ%]J1%BH4J_E.pngR]7PIK{)`17VSZR9M3H(3I1.png

    reply
    1
  • ChaoYoung

    The template engine resolves to Time is the timestamp. What js returns without refreshing is the timestamp without using the date function.

    ChaoYoung · 2017-07-24 11:50:48
    ChaoYoung

    The front-end js can be converted, or the background can be formatted and then assigned.

    ChaoYoung · 2017-07-25 15:14:04
     朱均其

    Then how to convert the timestamp into a normal date? Please help me.

     朱均其 · 2017-07-24 11:55:18
  • Cancelreply