Copyright © tutorialspoint.com
| string gmstrftime ( string $format [, int $timestamp] ); |
Behaves the same as strftime() except that the time returned is Greenwich Mean Time (GMT).
| Parameter | Description |
|---|---|
| format | required.Specifies how to return the result:
|
| timestamp | Optional. This is an integer Unix timestamp that defaults to the current local time if a timestamp is not given. In other words, it defaults to the value of time(). |
Returns a string formatted according to the given format string using the given timestamp or the current local time if no timestamp is given.
Following is the usage of this function:
<?php
setlocale(LC_TIME, 'en_US');
echo strftime("%b %d %Y %H:%M:%S",
mktime(20, 0, 0, 12, 31, 2005)) . "\n";
echo gmstrftime("%b %d %Y %H:%M:%S",
mktime(20, 0, 0, 12, 31, 2005)) . "\n";
?>
|
This will produce following result:
Dec 31 2005 20:00:00 Jan 01 2006 03:00:00 |
Copyright © tutorialspoint.com