亚洲国产日韩欧美一区二区三区,精品亚洲国产成人av在线,国产99视频精品免视看7,99国产精品久久久久久久成人热,欧美日韩亚洲国产综合乱

PHP Date

PHP 5 Date/Time 函數(shù) PHP Date/Time 簡(jiǎn)介 Date/Time 函數(shù)允許您從 PHP 腳本運(yùn)行的服務(wù)器上獲取日期和時(shí)間。您可以使用 Date/Time 函數(shù)通過(guò)不同的方式來(lái)格式化日期和時(shí)間。 注釋:這些函數(shù)依賴于服務(wù)器的本地設(shè)置。使用這些函數(shù)時(shí)請(qǐng)記住要考慮夏令時(shí)和閏年。 安裝 PHP Date/Time 函數(shù)是PHP 核心的組成部分。無(wú)需安裝即可使用這些函數(shù)。 Runtime 配置 Date/Time



PHP Date/Time 簡(jiǎn)介

Date/Time 函數(shù)允許您從 PHP 腳本運(yùn)行的服務(wù)器上獲取日期和時(shí)間。您可以使用 Date/Time 函數(shù)通過(guò)不同的方式來(lái)格式化日期和時(shí)間。

注釋:這些函數(shù)依賴于服務(wù)器的本地設(shè)置。使用這些函數(shù)時(shí)請(qǐng)記住要考慮夏令時(shí)和閏年。


安裝

PHP Date/Time 函數(shù)是PHP 核心的組成部分。無(wú)需安裝即可使用這些函數(shù)。


Runtime 配置

Date/Time 函數(shù)的行為受到 php.ini 中設(shè)置的影響:

名稱描述默認(rèn)PHP 版本
date.timezone規(guī)定默認(rèn)時(shí)區(qū)(所有的 Date/Time 函數(shù)使用該選項(xiàng))""PHP 5.1
date.default_latitude規(guī)定默認(rèn)緯度(date_sunrise() 和 date_sunset() 使用該選項(xiàng))"31.7667"PHP 5.0
date.default_longitude規(guī)定默認(rèn)經(jīng)度(date_sunrise() 和 date_sunset() 使用該選項(xiàng))"35.2333"PHP 5.0
date.sunrise_zenith規(guī)定默認(rèn)日出天頂(date_sunrise() 和 date_sunset() 使用該選項(xiàng))"90.83"PHP 5.0
date.sunset_zenith規(guī)定默認(rèn)日落天頂(date_sunrise() 和 date_sunset() 使用該選項(xiàng))"90.83"PHP 5.0


PHP 5 Date/Time 函數(shù)

函數(shù)描述
checkdate()驗(yàn)證格利高里日期。
date_add()添加日、月、年、時(shí)、分和秒到一個(gè)日期。
date_create_from_format()返回一個(gè)根據(jù)指定格式進(jìn)行格式化的新的 DateTime 對(duì)象。
date_create()返回一個(gè)新的 DateTime 對(duì)象。
date_date_set()設(shè)置一個(gè)新的日期。
date_default_timezone_get()返回默認(rèn)時(shí)區(qū),被所有的 Date/Time 函數(shù)使用。
date_default_timezone_set()設(shè)置默認(rèn)時(shí)區(qū),被所有的 Date/Time 函數(shù)使用。
date_diff()返回兩個(gè)日期間的差值。
date_format()返回根據(jù)指定格式進(jìn)行格式化的日期。
date_get_last_errors()返回日期字符串中的警告/錯(cuò)誤。
date_interval_create_from_date_string()從字符串的相關(guān)部分建立一個(gè) DateInterval。
date_interval_format()格式化時(shí)間間隔。
date_isodate_set()設(shè)置 ISO 日期。
date_modify()修改時(shí)間戳。
date_offset_get()返回時(shí)區(qū)偏移。
date_parse_from_format()根據(jù)指定的格式返回一個(gè)帶有指定日期的詳細(xì)信息的關(guān)聯(lián)數(shù)組。
date_parse()返回一個(gè)帶有指定日期的詳細(xì)信息的關(guān)聯(lián)數(shù)組。
date_sub()從指定日期減去日、月、年、時(shí)、分和秒。
date_sun_info()返回一個(gè)包含有關(guān)指定日期與地點(diǎn)的日出/日落和黃昏開(kāi)始/黃昏結(jié)束的信息的數(shù)組。
date_sunrise()返回指定日期與地點(diǎn)的日出時(shí)間。
date_sunset()返回指定日期與地點(diǎn)的日落時(shí)間。
date_time_set()設(shè)置時(shí)間。
date_timestamp_get()返回 Unix 時(shí)間戳。
date_timestamp_set()設(shè)置基于 Unix 時(shí)間戳的日期和時(shí)間。
date_timezone_get()返回給定 DateTime 對(duì)象的時(shí)區(qū)。
date_timezone_set()設(shè)置 DateTime 對(duì)象的時(shí)區(qū)。
date()格式化本地日期和時(shí)間。
getdate()返回某個(gè)時(shí)間戳或者當(dāng)前本地的日期/時(shí)間的日期/時(shí)間信息。
gettimeofday()返回當(dāng)前時(shí)間。
gmdate()格式化 GMT/UTC 日期和時(shí)間。
gmmktime()返回 GMT 日期的 UNIX 時(shí)間戳。
gmstrftime()根據(jù)區(qū)域設(shè)置格式化 GMT/UTC 日期和時(shí)間。
idate()格式化本地時(shí)間/日期為整數(shù)。
localtime()返回本地時(shí)間。
microtime()返回當(dāng)前 Unix 時(shí)間戳的微秒數(shù)。
mktime()返回一個(gè)日期的 Unix 時(shí)間戳。
strftime()根據(jù)區(qū)域設(shè)置格式化本地時(shí)間/日期。
strptime()解析由 strftime() 生成的時(shí)間/日期。
strtotime()將任何英文文本的日期或時(shí)間描述解析為 Unix 時(shí)間戳。
time()返回當(dāng)前時(shí)間的 Unix 時(shí)間戳。
timezone_abbreviations_list()返回包含夏令時(shí)、偏移量和時(shí)區(qū)名稱的關(guān)聯(lián)數(shù)組。
timezone_identifiers_list()返回帶有所有時(shí)區(qū)標(biāo)識(shí)符的數(shù)值數(shù)組。
timezone_location_get()返回指定時(shí)區(qū)的位置信息。
timezone_name_from_ abbr()根據(jù)時(shí)區(qū)縮略語(yǔ)返回時(shí)區(qū)名稱。
timezone_name_get()返回時(shí)區(qū)的名稱。
timezone_offset_get()返回相對(duì)于 GMT 的時(shí)區(qū)偏移。
timezone_open()創(chuàng)建一個(gè)新的 DateTimeZone 對(duì)象。
timezone_transitions_get()返回時(shí)區(qū)的所有轉(zhuǎn)換。
timezone_version_get()返回時(shí)區(qū)數(shù)據(jù)庫(kù)的版本。


PHP 5 預(yù)定義的 Date/Time 常量

常量描述
DATE_ATOMAtom (例如:2005-08-15T16:13:03+0000)
DATE_COOKIEHTTP Cookies (例如:Sun, 14 Aug 2005 16:13:03 UTC)
DATE_ISO8601ISO-8601 (例如:2005-08-14T16:13:03+0000)
DATE_RFC822RFC 822 (例如:Sun, 14 Aug 2005 16:13:03 UTC)
DATE_RFC850RFC 850 (例如:Sunday, 14-Aug-05 16:13:03 UTC)
DATE_RFC1036RFC 1036 (例如:Sunday, 14-Aug-05 16:13:03 UTC)
DATE_RFC1123RFC 1123 (例如:Sun, 14 Aug 2005 16:13:03 UTC)
DATE_RFC2822RFC 2822 (例如:Sun, 14 Aug 2005 16:13:03 +0000)
DATE_RSSRSS (例如:Sun, 14 Aug 2005 16:13:03 UTC)
DATE_W3C萬(wàn)維網(wǎng)聯(lián)盟 (例如:2005-08-14T16:13:03+0000)