XVII.Date and Time Functions

介紹

These functions allow you to get the date and time from the server where your PHP scripts are running. You can use these functions to format the date and time in many different ways.

備注: Please keep in mind that these functions are dependent on the locale settings of your server. Make sure to take daylight saving time and leap years into consideration when working with these functions.

需求

建立這個延伸不需要任何外部程式庫。

安裝

這些函數是PHP核心的一部分,不需要安裝就可使用。

執行時期組態

php.ini中沒有定義此延伸的組態指令。

資源類型

這個延伸沒有定義任何資源。

預先定義常數

這個延伸沒有定義任何常數。

目錄
checkdate -- Validate a Gregorian date
date -- Format a local time/date
getdate -- Get date/time information
gettimeofday -- Get current time
gmdate -- Format a GMT/UTC date/time
gmmktime -- Get Unix timestamp for a GMT date
gmstrftime --  Format a GMT/UTC time/date according to locale settings
idate --  Format a local time/date as integer
localtime -- Get the local time
microtime --  Return current Unix timestamp with microseconds
mktime -- Get Unix timestamp for a date
strftime --  Format a local time/date according to locale settings
strtotime --  Parse about any English textual datetime description into a Unix timestamp
time -- Return current Unix timestamp