Returns the Unix timestamp for a specified date and then use it to determine the day of that date.
<?php // Prints: October 3, 1975 was on a Friday echo “Oct 3, 1975 was on a “.date(“l”, mktime(0,0,0,10,3,1975)); ?> |
The mktime()
function returns the Unix timestamp for a specified date.
Tip: This function is similar to gmmktime()
, except that the parameters represent a local date rather than a GMT date.
mktime(hour, minute, second, month, day, year, is_dst) |
Parameter |
Description |
hour |
Optional. Specifies the hour. |
minute |
Optional. Specifies the minute. |
second |
Optional. Specifies the second. |
month |
Optional. Specifies the month. |
day |
Optional. Specifies the day. |
year |
Optional. Specifies the year. |
is_dst |
Optional. Set this parameter to |
Return Value: |
Returns an integer Unix timestamp or |
PHP Version: |
4+ |
PHP Changelog: |
PHP 7.1: The is_dst parameter is removed. PHP 5.3.0: Issues an E_DEPRECATED warning if the is_dst parameter is used. PHP 5.1: The is_dst parameter was deprecated. If mktime() is called with no arguments, it now triggers an E_STRICT notice. Use the time() function instead. |