PHP Mktime错误

我突然在我已经完成的网站上收到以下错误,到目前为止工作正常:

A PHP Error was encountered

Severity: Warning

Message: mktime() [function.mktime]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning,you most likely misspelled the timezone identifier. We selected 'Antarctica/Macquarie' for 'EST/10.0/no DST' instead

这是有问题的代码

$stamp=mktime(0,$month,$day,$year);

这是什么问题?如何快速消除这些错误?我在很多地方都使用那种格式的mktime,并且每个地方都会出错.

解决方法

错误所示,您需要使用date_default_timezone_set(‘Antarctica / Macquarie’)指定时区;或ini_set(‘date.timezone’,’Antarctica / Macquarie’);在您的代码中或在PHP.ini中定义date.timezone.

相关文章

统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...
前言 之前做了微信登录,所以总结一下微信授权登录并获取用户...
FastAdmin是我第一个接触的后台管理系统框架。FastAdmin是一...
之前公司需要一个内部的通讯软件,就叫我做一个。通讯软件嘛...
统一支付是JSAPI/NATIVE/APP各种支付场景下生成支付订单,返...