Home > PHP > Function > Date/Time > gmdate()

gmdate()

gmdate - Format a GMT/UTC date/time

Syntax

string gmdate (string $format, int $timestamp)

Arguments

  • format - The format of the outputted date string. See the formatting options for the date() function.
  • 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().

Description

Identical to the date() function except that the time returned is Greenwich Mean Time (GMT).

Version

PHP 4, 5

Return value

Returns a formatted date string. If a non-numeric value is used for timestamp, FALSE is returned and an E_WARNING level error is emitted.