Share on Google+Share on Google+


This is an example of formatting the date/time in Green Witch Mean Time (GMT) Format.

PHP gmmktime() Function

The gmmktime() function returns a Unix timestamp for a GMT date. However, this function is identical to mktime() except the passed parameters represents a GMT date.

Syntax on gmmktime() Function PHP


Parameter & Description of gmmktime() Function PHP

hour- Optional. Specifies the hour
minute - Optional. Specifies the minute
second - Optional. Specifies the second
month - Optional. Specifies the numerical month
day - Optional. Specifies the day
year - Optional. Specifies the year. The valid range for year is on some systems between 1901 and 2038. However this limitation is overcome in PHP 5
is_dst - Optional. Parameters always represent a GMT date so is_dst doesn't influence the result. 

Example of gmmktime() Function PHP:

$my_birthday = gmmktime(0,0,0,03,8,1978);
print($my_birthday . "<br />");

The output of the code above would be:


Posted on: August 28, 2009 If you enjoyed this post then why not add us on Google+? Add us to your Circles

Share this Tutorial Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.