PHP - Function gmmktime()


Advertisements


Syntax

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

Definition and Usage

This function is identical to mktime() except the passed parameters represents a GMT date. gmmktime() internally uses mktime() so only times valid in derived local time can be used.

Parameters

Sr.No Parameter & Description
1

hour

Optional. Specifies the hour

2

minute

Optional. Specifies the minute

3

second

Optional. Specifies the second

5

month

Optional. Specifies the numerical month

6

day

Optional. Specifies the day

7

year

Optional. Specifies the year.

8

is_dst

Optional. Parameters always represent a GMT date so is_dst doesn't influence the result.

Return Value

Returns a integer Unix timestamp.

Example

Following is the usage of this function −

<?php
   $timestamp = gmmktime(0,0,0,8,6,1971);
   
   print($timestamp . "\n");
?>

This will produce the following result −

50284800

php_function_reference.htm