PHP chdir() 函数PHP Directory 函数实例改变当前的目录:<?php// 获取当前目录echo getcwd() . "<br>";// 改变目录chdir("images");// 获得当前目录echo getcwd();?>结果:/ho
PHP timezone_version_get() 函数PHP Date / Time 函数实例返回时区数据库的版本:<?phpecho timezone_version_get();?>完整实例:<!DOCTYPE html><html><body><?phpecho timez
PHP timezone_open() 函数PHP Date / Time 函数实例创建新的 DateTimeZone 对象,然后返回时区的名称:<?php$tz=timezone_open("Asia/Shanghai");echo timezone_name_get($tz);
PHP timezone_offset_get() 函数PHP Date / Time 函数实例返回相对于 GMT 的时区偏移:<?php$tz=timezone_open("Asia/Taipei");$dateTimeNY=date_create("now",timezone_open
PHP timezone_name_get() 函数PHP Date / Time 函数实例返回时区的名称:<?php$tz=timezone_open("America/New_York");echo timezone_name_get($tz);?>完整实例:<!DOCTYPE htm
PHP timezone_name_from_abbr() 函数PHP Date / Time 函数实例根据时区缩略语返回时区名称:<?phpecho timezone_name_from_abbr("EST") . "<br>";echo timezone_name_from_ab
PHP timezone_location_get() 函数PHP Date / Time 函数实例返回指定时区的位置信息:<?php$tz=timezone_open("America/New_York");echo timezone_location_get($tz);?>完整
PHP timezone_identifiers_list() 函数PHP Date / Time 函数实例输出亚洲的所有时区:<?phpprint_r(timezone_identifiers_list(16));?>完整实例:<!DOCTYPE html><html><body><
PHP timezone_abbreviations_list() 函数PHP Date / Time 函数实例输出 "act" 时区的夏令时(dst)、偏移量和时区名称:<?php$tzlist=timezone_abbreviations_list();print_r($tz
PHP time() 函数PHP Date / Time 函数实例返回当前时间的 Unix 时间戳,并格式化为日期:<?php$t=time();echo($t . "<br>");echo(date("Y-m-d",$t));?>完整实例:<!DOCTYPE html>
PHP strtotime() 函数PHP Date / Time 函数实例将英文文本日期时间解析为 Unix 时间戳:<?phpecho(strtotime("now") . "<br>");echo(strtotime("15 October 1980") . "<br>")
PHP strptime() 函数PHP Date / Time 函数实例解析由 strftime() 生成的时间/日期:<?php$format="%d/%m/%Y %H:%M:%S";$strf=strftime($format);echo("$strf");print_r(strpt
PHP strftime() 函数PHP Date / Time 函数实例根据区域设置来格式化本地日期和时间:<?phpecho(strftime("%B %d %Y, %X %Z",mktime(20,0,0,12,31,98))."<br>");setlocale(LC_
PHP mktime() 函数PHP Date / Time 函数实例返回一个日期的 UNIX 时间戳。然后使用它来查找该日期的天:<?php// 输出:October 3, 1975 was on a Fridayecho "Oct 3, 1975 was
PHP microtime() 函数PHP Date / Time 函数实例返回当前 Unix 时间戳的微秒数:<?phpecho(microtime());?>完整实例:<!DOCTYPE html><html><body><?phpecho(microtime());/** *