PHP gmmktime () function
PHP Date / Time Reference Manual
Examples
Returns the UNIX timestamp for a GMT date, and then use it to find the day of the 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));
?>
Running instance »
Definition and Usage
gmmktime () function returns the date UNIX GMT timestamp.
Tip: This function mktime () the same, except that the passed parameter represents a GMT date.
grammar
gmmktime( hour,minute,second,month,day,year,is_dst );
参数 | 描述 |
---|---|
hour | 可选。规定小时。 |
minute | 可选。规定分。 |
second | 可选。规定秒。 |
month | 可选。规定月。 |
day | 可选。规定天。 |
year | 可选。规定年。 |
is_dst | 可选。参数总是代表 GMT 日期,所以 is_dst 不影响结果。 注意:该参数在 PHP 5.1.0 中被废弃。取而代之使用的是新的时区处理特性。 |
technical details
return value: | Returns an integer Unix timestamp. |
---|---|
PHP version: | 4+ |
Update log: | PHP 5.1.0: is_dst parameters are discarded. |
PHP Date / Time Reference Manual