F.9. Date and Time
Function | Returns | Description |
---|---|---|
time(void) | int | Returns current UNIX timestamp. |
mktime(int hour, int min, int sec, int mon, int day, int year) | int | Gets UNIX timestamp for a date. |
gmmktime(int hour, int min, int sec, int mon, int day, int year) | int | Gets UNIX timestamp for a GMT date. |
date(string format [, int timestamp]) | string | Formats a local time/date. |
gmdate(string format [, int timestamp]) | string | Formats a GMT/UTC date/time. |
idate(string format [, int timestamp]) | int | Formats a local time/date as integer. |
localtime([int timestamp [, bool associative_array]]) | array | Returns the results of the C system call local time as an associative array if the associative_array argument is set to 1 (otherwise it's a regular array). |
getdate([int timestamp]) | array | Gets date/time information. |
checkdate(int month, int day, int year) | bool | Returns true(1) if it is a valid date in Gregorian calendar. |
strftime(string format [, int timestamp]) | string | Formats a local time/date according to locale settings. |
gmstrftime(string format [, int timestamp]) | string | Formats a GMT/UTC time/date according to locale settings. |
strtotime(string time, int now) | int | Converts string representation of date and time to a timestamp. |
microtime(void) | string | Returns a string containing the current time in seconds and microseconds. |
gettimeofday(void) | array | Returns the current time as array. |
getrusage([int who]) | array | Returns an array of usage statistics. |
date_sunrise(mixed time [, int format [, float latitude [, float longitude ... |
Get Web Standards Programmer's Reference: HTML, CSS, JavaScript®, Perl, Python®, and PHP now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.