Return the UNIX timestamp of a date, which can then be used to find the day of the date:
<?php// Prints: October 3, 1975 was on a Fridayecho "Oct 3, 1975 was on a ".date("l", mktime(0,0,0,10,3,1975));?>The gmmktime() function returns the UNIX timestamp of a date.
Tip: This function is the same as gmmktime(), except that the parameter passed represents a date (not a GMT date).
mktime( hour, minute, second, month, day, year, is_dst );
parameter | describe |
---|---|
hour | Optional. Specified hours. |
minute | Optional. prescribed points. |
second | Optional. Specifies seconds. |
month | Optional. Specified month. |
day | Optional. Specify days. |
year | Optional. Specified year. |
is_dst | Optional. Set to 1 if the time is during daylight saving time, 0 otherwise, or -1 (default) if unknown. If unknown, PHP will try to find it itself (possibly producing unexpected results). Note: This parameter is deprecated in PHP 5.1.0. Instead, new time zone handling features are used. |
Return value: | Returns an integer Unix timestamp, or FALSE on error. |
---|---|
PHP version: | 4+ |
Update log: | PHP 5.3.0: Throws E_DEPRECATED if is_dst parameter is used. PHP 5.1.0: The is_dst parameter is deprecated. If mktime() is called without parameters, an E_STRICT notification is thrown. Please use the time() function instead. |