Anonymous user / 3.138.134.163 Log In Register
?
Wallet: 3.00
Daily Credits:
1.20 / 1.20

PHP Functions Online


gmstrftime

(PHP 4, PHP 5)

gmstrftimeFormat a GMT/UTC time/date according to locale settings

string gmstrftime(string $format[, int $timestamp = time()])

Checkout ? #

Item Description Item Price Your Price
Total

Preview #

${{ variable.param.name }} = {{ variable.param|getValue:variable.form:true }};
{{ call.result}} = ;

Description #

string gmstrftime ( string $format [, int $timestamp = time() ] )

Behaves the same as strftime() except that the time returned is Greenwich Mean Time (GMT). For example, when run in Eastern Standard Time (GMT -0500), the first line below prints "Dec 31 1998 20:00:00", while the second prints "Jan 01 1999 01:00:00".

Parameters #

format

See description in strftime().

timestamp

The optional timestamp parameter 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().

Return Values #

Returns a string formatted according to the given format string using the given timestamp or the current local time if no timestamp is given. Month and weekday names and other language dependent strings respect the current locale set with setlocale().

Examples #

Example #1 gmstrftime() example

<?php
setlocale
(LC_TIME'en_US');
echo 
strftime("%b %d %Y %H:%M:%S"mktime(2000123198)) . "\n";
echo 
gmstrftime("%b %d %Y %H:%M:%S"mktime(2000123198)) . "\n";
?>

See Also #