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

PHP时间格式问题

PHP time format generate different results when spaces included

 date('h:i A',strtotime('05:45 AM')); //05:45AM
 date('h:i A',strtotime('05 : 45 AM')); // 01:00 AM

Here is the result

Spaces works in older version of PHP and it is failing in PHP Version above 5.0.5; I wanted to check why this is not allowed with new version

As stated in the comments, its not a valid time format with the spaces.

Check this resource for strtotime: http://us1.php.net/manual/en/function.strtotime.php

And also check this page for date/time formats: http://us1.php.net/manual/en/datetime.formats.php

近期文章

  • mcrypt解码数据类型
  • Eventbrite.php错误
  • Postgresql php插入图片
  • 使用isset进行修正?
  • 在xml中调用php变量
  • 基表或视图已存在:1050表'sales_flat_order'已存在
  • PHP:抽象静态函数最佳实践
  • MySQL STR_TO_DATE()返回无效日期
  • 表有3个分离度
  • WordPress - 实时更新数据库值。
  • 与codeigniter连接时出错:变量查询
  • lynx cronjob调用,但HTTP请求未发送
  • 在else中的</ div>之后没有显示内容if
  • 检测国家/地区,显示产品是否可用[关闭]
  • TCPDF未显示XSL元素值
  • 隐藏DOM中的数据库属性
  • 使用mysql_insert_id从表中返回列的ID
  • 我怎样才能在PHP中计算出所有数组值的MD5
  • 在wampserver 2.4 windows 8上安装Joomla 3.2.3时出错
  • 可以在Yii Framework中使用核心php mysql函数吗?

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

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

友情链接:代码精华