PHP gmmktime() Function

What is a gmmktime Function?

Explanation

The "gmmktime()" function is used get a unix timestamp for a GMT time.

Syntax:


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

In the above syntax the parameters for the function are hour, minute, second, month, day, year, is_dst. All these parameters are optional.

Example :


<?php
$my_dob = gmmktime(0,0,0,10,3,1976);
print($my_birthday."<br/>");
print(date("M-d-Y",$my_dob));
?>
Result :

181526400
Oct-03-1976

In the above example the date() function will return the formatted value of the unix timestamp based on the GMT timezone values.

Note :

(PHP 4, PHP 5)

PHP Topics


Ask Questions

Ask Question