使用PHP5的date_default_timezone_set()在共享主机上设置站点的日期/时间设置

One annoyance with putting my customer's site on shared hosting is not being able to control the date and time on the hosting server. Sure, I could simply host with a local company but that's not always the most cost-effective option.

将我的客户的网站置于共享托管上的一个烦人之处是无法控制托管服务器上的日期和时间。 当然,我可以简单地在一家本地公司托管,但这并不总是最具成本效益的选择。

I use a new function to PHP5, the date_default_timezone_set() function, which allows you to set your time zone. The obvious requirement is PHP5. PHP4 is no longer supported so I look forward to seeing more servers hosting PHP5.

我对PHP5使用了一个新函数,即date_default_timezone_set()函数,该函数可用于设置时区。 明显的要求是PHP5。 不再支持PHP4,因此我期待看到更多托管PHP5的服务器。

date_default_timezone_set('America/Chicago');

Check out the full list of time zones to see which one you should use.

请查看完整的时区列表,以查看应使用的时区

翻译自: https://davidwalsh.name/set-your-sites-datetime-settings-on-shared-hosting-using-php5s-date_default_timezone_set

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值