[英]How to get date and time with PHP,
I used to get the date and time like this in PHP: 我曾经在PHP中得到这样的日期和时间:
date_default_timezone_set('America/New_York');
$info = getdate();
$date = $info['mday'];
$month = $info['mon'];
$year = $info['year'];
$hour = $info['hours'];
$min = $info['minutes'];
$sec = $info['seconds'];
$time = "D/M/Y= $date/$month/$year H/M/S= $hour:$min:$sec";
Although, now whenever I run it, $time ends up: "0". 虽然,现在每当我运行它时,$ time结束:“0”。
Is there an alternative to this method? 有这种方法的替代方案吗?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.