我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

php中的时差计算[关闭]

Lets suppose start time= 2200 and end time= 0500. In PhP how can we check a given time is between start and end time? I only want to check the time, regardless of the date.

if(date("Hi") >= 500 && date("Hi") <= 2200)

And since your minutes are 00 you can do

if(date("H") >= 5 && date("H") <= 22)

近期文章

  • php artisan clear-compiled失败
  • 使用jQuery加载页面内容?
  • 在php中使用javascript数据错误
  • 验证没有帖子的symfony表单
  • PHP(5.5),WebMatrix,SMTP和Windows
  • PHP代码不执行(PHP新手)
  • Php - 将字符串中的数字相乘
  • 在PHP中使用SOAP MTOM发送文件
  • 我该如何存储我的用户图像? [关闭]
  • 私人留言系统[收件箱查询]
  • 使用PHP接口修改HTML
  • 将变量从Flash传递到PHP
  • 无法在脚本中导入matplotlib
  • PHP MySQL值传递给JavaScript
  • PHP注意 - yii \ base \ ErrorException
  • 从mysql中比较PHP中的两个日期
  • Mysql查询找不到第一个单词
  • 标题位置不适用于Php
  • Wordpress内联php不起作用
  • 将HTML表单输入添加到数据库

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华