Copyright © tutorialspoint.com

PHP Function gmmktime()

previous
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.

Paramters

ParameterDescription
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.
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 following result:

50284800
Aug-05-1971
previous

Copyright © tutorialspoint.com