Home > Backend Development > PHP Tutorial > 有个问题没有解决.

有个问题没有解决.

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-23 14:09:30
Original
942 people have browsed it

<?phpdate_default_timezone_set('America/Adak');$date = date('2013-05-09 11-00-00'); for($day=0; $day<7; $day++)  for($second=0; $second<60; $second++)        echo date('Y-m-d H-i-s', strtotime("+$day day $second second +$date")) . '<br>';?>
Copy after login
Copy after login

为什么运行出错呢?H:i:s不能用“-”这个符号吗


回复讨论(解决方案)

<?phpdate_default_timezone_set('America/Adak');$date = date('2013-05-09 11-00-00'); for($day=0; $day<7; $day++)  for($second=0; $second<60; $second++)        echo date('Y-m-d H-i-s', strtotime("+$day day $second second +$date")) . '<br>';?>
Copy after login
Copy after login

为什么运行出错呢?H:i:s不能用“-”这个符号吗

是的,不可以,因为strtotime(date('2013-05-09 11-00-00'))获取不到时间戳

日期格式必须正确,虽然每个国家使用的日期格式不尽相同,但都是有其规范的
错了就不能识别了

谢谢高手~~~~~~~~

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template