PHP gmmktime() Function
Example
Returns the UNIX timestamp of the GMT date and then uses it to find the day of the date:
<?php // Output: October 3, 1975 was on a Friday echo "Oct 3, 1975 was on a ".date("l", gmmktime(0,0,0,10,3,1975)); ?>
Definition and Usage
The gmmktime() function returns the UNIX timestamp of the GMT date.
Tip:This function is similar to mktime() Same, but the parameters passed represent GMT dates.
Syntax
gmmktime(hour,minute,second,month,day,year,is_dst);
Parameter | Description |
---|---|
hour | Optional. Specify the hour. |
minute | Optional. Specify the minute. |
second | Optional. Specify the second. |
month | Optional. Specify the month. |
day | Optional. Specify the day. |
year | Optional. Specify the year. |
is_dst |
Optional. The parameter always represents GMT date, so is_dst Does not affect the result. Note:This parameter has been deprecated in PHP 5.1.0. Instead, use the new timezone handling features. |
Technical Details
Return Value: | Returns an integer Unix timestamp. |
---|---|
PHP Version: | 4+ |
Update Log: | PHP 5.1.0:is_dst The parameter has been deprecated. |