使用服务器时间重定向页面,格式为0-12

时间:2018-01-29 19:16:04

标签: php

我在php中有以下代码片段,以便使用服务器的时间重定向到不同的页面。问题是服务器使用时间0-12格式而不是0-24。知道如何改进我的代码以便工作吗?

php?

  $timer=date('H:i:s');

  //redirect if hour between 8:00 to 21:00
  if(  ($timer > "08:00:00")  &&  ($timer < "21:00:00") ) {
    header('Location: index.php');
  }else{
    header('Location: logout.php');
  }

1 个答案:

答案 0 :(得分:-1)

File.prototype.download = function(options, callback) { if (is.fn(options)) { callback = options; options = {}; } callback = once(callback); var destination = options.destination; delete options.destination; // <--- here // ... 是24小时无时区设置的小时表示 date('H')代表12小时,如果您不想要领先零,则date('h')