PHP gmmktime() Function
In this chapter you will learn:
- Definition for PHP gmmktime() Function
- Syntax for PHP gmmktime() Function
- Parameter for PHP gmmktime() Function
- Return value from PHP gmmktime() Function
- Note for PHP gmmktime() Function
- Example - Return the Unix timestamp for a GMT date. Then use it to find the day of that date
Definition
The gmmktime() function returns the Unix timestamp for a GMT date.
Syntax
PHP gmmktime() Function has the following syntax. gmmktime(hour,minute,second,month,day,year,is_dst);
Parameter
Parameter | Is Required | Description |
---|---|---|
hour | Optional. | hour value |
minute | Optional. | minute value |
second | Optional. | second value |
month | Optional. | month value |
day | Optional. | day value |
year | Optional. | year value |
Return
PHP gmmktime() Function returns an integer Unix timestamp.
Note
This function is identical to mktime() except the passed parameters represents a GMT date.
Example
Return the Unix timestamp for a GMT date. Then use it to find the day of that date:
<?php
echo date("l", gmmktime(0,0,0,10,3,2013));
?>
The code above generates the following result.
Next chapter...
What you will learn in the next chapter:
- Definition for PHP gmstrftime() Function
- Syntax for PHP gmstrftime() Function
- Parameter for PHP gmstrftime() Function
- Format for PHP gmstrftime() Function
- Return value for PHP gmstrftime() Function
- Example - Format GMT/UTC date and time according to locale settings
Home » PHP Tutorial » PHP Date Functions