Create Variable in PHP Equal to Current Time Minus One Hour

前端 未结 9 1312
青春惊慌失措
青春惊慌失措 2020-12-11 15:12

In PHP, how could I create a variable called $livetime that equals the current time minus 1 hour?

9条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-11 15:29

    If you're looking for how to display the time in a human readable format, these examples will help:

    $livetime = date('H:i:s', time() - 3600); // 16:00:00
    $livetime = date('g:iA ', time() - 3600); // 4:00PM
    

提交回复
热议问题