第一范文网 - 专业文章范例文档资料分享平台

PHP函数库分类十三

来源:用户分享 时间:2025/7/23 6:05:45 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

PHP函数库分类十三

3. Date/Time函数列表(五)

? time - 返回当前的 Unix 时间戳

time — 返回当前的 Unix 时间戳

说明 int time ( void ) 返回自从 Unix 纪元(格林威治时间 1970 年 1 月 1 日 00:00:00)到当前时间的秒数。 Tip

自 PHP 5.1 起在 $_SERVER['REQUEST_TIME'] 中保存了发起该请求时刻的时间戳。

Example #1 time() 例子

$nextWeek = time() + (7 * 24 * 60 * 60);

// 7 days; 24 hours; 60 mins; 60secs echo 'Now: '. date('Y-m-d') .\;

echo 'Next Week: '. date('Y-m-d', $nextWeek) .\; ?>

以上例程的输出类似于:

Now: 2005-03-30 Next Week: 2005-04-07

? timezone_abbreviations_list - 别名 DateTimeZone::listAbbreviations

timezone_abbreviations_list — 别名 DateTimeZone::listAbbreviations()

说明 此函数是该函数的别名: DateTimeZone::listAbbreviations()

? timezone_identifiers_list - 别名 DateTimeZone::listIdentifiers

timezone_identifiers_list — 别名 DateTimeZone::listIdentifiers()

说明 此函数是该函数的别名: DateTimeZone::listIdentifiers()

? timezone_location_get - 别名 DateTimeZone::getLocation

timezone_location_get — 别名 DateTimeZone::getLocation()

说明 此函数是该函数的别名: DateTimeZone::getLocation()

? timezone_name_from_abbr - Returns the timezone name from abbreviation

timezone_name_from_abbr — Returns the timezone name from abbreviation

说明 string timezone_name_from_abbr ( string $abbr [, int $gmtOffset = -1 [, int$isdst = -1 ]] ) 参数 abbr

Time zone abbreviation.

gmtOffset

Offset from GMT in seconds. Defaults to -1 which means that first found time zone corresponding to abbr is returned. Otherwise exact offset is searched and only if

not found then the first time zone with any offset is returned.

isdst

Daylight saving time indicator. Defaults to -1, which means that whether the time zone has daylight saving or not is not taken into consideration when searching. If this is set to 1, then the gmtOffset is assumed to be an offset with daylight saving in effect; if 0,

then gmtOffset is assumed to be an offset without daylight saving in effect. If abbr doesn't exist then the time zone is searched solely by the gmtOffset and isdst.

返回值 Returns time zone name on success 或者在失败时返回 FALSE.

范例 Example #1 A timezone_name_from_abbr() example

echo timezone_name_from_abbr(\) . \;

echo timezone_name_from_abbr(\, 3600, 0) . \; ?>

以上例程的输出类似于:

Europe/Berlin Europe/Paris

? timezone_name_get - 别名 DateTimeZone::getName

timezone_name_get — 别名 DateTimeZone::getName()

说明 此函数是该函数的别名: DateTimeZone::getName()

? timezone_offset_get - 别名 DateTimeZone::getOffset

timezone_offset_get — 别名 DateTimeZone::getOffset()

说明 此函数是该函数的别名: DateTimeZone::getOffset()

? timezone_open - 别名 DateTimeZone::__construct

timezone_open — 别名 DateTimeZone::__construct()

说明 此函数是该函数的别名: DateTimeZone::__construct()

? timezone_transitions_get - 别名 DateTimeZone::getTransitions

timezone_transitions_get — 别名 DateTimeZone::getTransitions()

说明 此函数是该函数的别名: DateTimeZone::getTransitions()

? timezone_version_get - Gets the version of the timezonedb

timezone_version_get — Gets the version of the timezonedb

说明 string timezone_version_get ( void ) Returns the current version of the timezonedb.

返回值 Returns a string. 范例 Example #1 Getting the timezonedb version

echo timezone_version_get(); ?>

以上例程的输出类似于:

2009.7

搜索更多关于: PHP函数库分类十三 的文档
PHP函数库分类十三.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c2o5w47e7fp2xn8u9vo4i_1.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top