PHP gmmktime()Function
PHP Date/Time Reference Manual
Examples
Returns the UNIX timestamp for a GMT date, then uses it to find the day of that date:
<?php
// Prints: October 3, 1975 was on a Friday
echo "Oct 3, 1975 was on a ".date("l", gmmktime(0,0,0,10,3,1975));
?>
// Prints: October 3, 1975 was on a Friday
echo "Oct 3, 1975 was on a ".date("l", gmmktime(0,0,0,10,3,1975));
?>
Run Example »
Definition and Usage
The gmmktime() function returns the UNIX timestamp for a GMT date.
Tip:This function is the same asmktime()mktime(), except that the parameters passed represent a GMT date.
Syntax
gmmktime(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. The parameter always represents a GMT date, so is_dst does not affect the result.Note:This parameter was deprecated in PHP 5.1.0. Use the new timezone handling features instead. |
Technical Details
| Return Value: | Returns an integer Unix timestamp. |
|---|---|
| PHP Version: | 4+ |
| Changelog: | PHP 5.1.0:is_dstThe parameter was deprecated. |
PHP Date/Time Reference Manual Other Extensions