程序中添加时间的初始化语句:“date_default_timezone_set("asia/shanghai");
定义和用法
the date_default_timezone_set() function sets the default timezone used by all date/time functions.
date_default_timezone_set()函数的作用是:设定用于一个脚本中所有日期时间函数的默认时区。
date_default_timezone_set(timezone) |
parameter 参数 |
description 描述 |
---|---|
timezone | required. the timezone identifier, like "utc" or "europe/paris". list of valid timezones: http://www.php教程.net/manual/en/timezones.php 必要参数,时区确认器,如“utc”或“europe/paris”。下面列出了有效的时区:http://www.php.net/manual/en/timezones.php |
note: this function always returns true (even if the timezone parameter isn't valid).
注意:这个函数总是返回true(即使时区参数无效的情况下)。
the output of the code above will be:
上述代码将输出下面的结果:
广发证券与HashKey在香港推出代币化证券 助力城市推进加密雄心
买入区域已激活:加密货币抛售后,山寨币蓄势待发
马斯克Neuralink发布会震撼来袭:七人已植入脑机介面改变人生、下一步终结盲人,超狂路线图公开
为什么花140美元买Solana,而Kaanch只要0.64美元?(限时优惠)
随着山寨币势头回升,当前最值得关注的三大预售加密货币——其中一款已筹集超3亿美元
首席软件工程师表示,Ripple技术上并不持有380亿XRP代币