PHP gmmktime() Function

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

ParameterIs RequiredDescription
hourOptional.hour value
minuteOptional.minute value
secondOptional.second value
monthOptional.month value
dayOptional.day value
yearOptional.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.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions