PHP DateTime构造日期字符串时“in”与“of”的差异及报错问题咨询
PHP DateTime构造日期字符串时“in”与“of”的差异及报错问题咨询
我实在搞不明白,为什么在PHP的DateTime类里,用字符串来构造日期的时候,"in"和"of"这两个词的差别会这么大?
比如这段代码完全能正常运行:
$LastSunday = new \DateTime('last Sunday of March '.$theYear);
可一旦把"of"换成"in",就会直接抛出错误,提示“时区未在数据库中找到”:
$LastSunday = new \DateTime('last Sunday in March '.$theYear);
我到底漏掉了什么关键信息啊?
备注:内容来源于stack exchange,提问作者Matthew Brown aka Lord Matt
相关产品推荐
相关产品推荐

