PHP gmmktime() function

Example

Returns the UNIX timestamp of a 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));
?>

Run Example

Definition and Usage

The gmmktime() function returns the UNIX timestamp of a GMT date.

Tip:This function is similar to mktime() Same, but the parameters passed represent a GMT date.

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 a GMT date, so is_dst Does not affect the result.

Note:This parameter has been deprecated in PHP 5.1.0. Instead, new timezone handling features are used.

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.