update : 2015.11.03
php.shukuma.com

검색:
 
 
Format a GMT/UTC time/date according to locale settings

gmstrftime

(PHP 4, PHP 5, PHP 7)

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

설명

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

인수

format

See description in strftime().

timestamp

선택적인 timestamp 인수는 timestamp가 주어지지 않았을 경우, 현재 로컬 시간을 기본값으로 가지는 integer 유닉스 타임스탬프입니다. 즉, 기본값은 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. Month and weekday names and other language dependent strings respect the current locale set with setlocale().

예제

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";
?>

참고

  • strftime() - Format a local time/date according to locale settings