javascript与php时间转时间缀
更新:HHH   时间:2023-1-7


  1. javascript:
    a. 代码:
    var strtime = '2018-01-01 00:00:00';
    var date = new Date(strtime);
    var time = date.getTime().toString();
    time = time.slice(0,10)
    console.log(time)

    b. 输出:

    1514736000
  2. php:
    a. 代码:
    $time = strtotime("2018-01-01 00:00:00");
    echo $time;

    b. 输出:

    1514736000
返回web开发教程...