RedBeanPHP-R :: isoDateTime()-如何设置时区? [英] RedBeanPHP - R::isoDateTime() - How to set timezone?
本文介绍了RedBeanPHP-R :: isoDateTime()-如何设置时区?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
RedBeanPHP ORM中有一个便利功能,用于确定日期.
There is a convenience function in RedBeanPHP ORM for ceating dates.
$time = R::isoDateTime();
如何设置时区?
默认功能不返回运行RB的计算机的时间.
The default function does not return the time of the machine on which RB is running on.
推荐答案
It appears from reading the source code, that R::isoDateTime()
is just a convenience method. It simply calls the PHP time()
function, then formats the result as a string using the date
function.
我没有测试它,但是从理论上讲-date_default_timezone_set
函数应该起作用.例如:
I didn't test it, but in theory - the date_default_timezone_set
function should work. For example:
date_default_timezone_set('America/Los_Angeles');
这篇关于RedBeanPHP-R :: isoDateTime()-如何设置时区?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文