PHP函数库分类十三

loading 分享 2026-8-19 下载文档

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函数库分类十三.doc 将本文的Word文档下载到电脑
搜索更多关于: PHP函数库分类十三 的文档
相关推荐
相关阅读