gmmktime()


 

gmmktime()

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

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

gmmktime(hour,minute,second,month,day,year,is_dst)

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:

<?php
$my_birthday = gmmktime(0,0,0,03,8,1978);
print($my_birthday . "<br />");
print(date("M-d-Y",$my_birthday));
?>

The output of the code above would be:
345695234
Mar-08-1978

Ads