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)

It specifies the hour

2

minute(Optional)

It specifies the minute

3

second(Optional)

It specifies the second

5

month(Optional)

It specifies the numerical month

6

day(Optional)

It specifies the day

7

year(Optional)

.It specifies the year.

8

is_dst(Optional)

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

Return Value

It returns a integer Unix timestamp.

Example

Following is the usage of this function −

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

This will produce the following result −

50284800

php_function_reference.htm

Advertisements