Monday, 26 August 2013

PHP Function gmmktime()

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
hourOptional. Specifies the hour
minuteOptional. Specifies the minute
secondOptional. Specifies the second
monthOptional. Specifies the numerical month
dayOptional. Specifies the day
yearOptional. Specifies the year.
is_dstOptional. 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

No comments:

Post a Comment