gmdate

Format a GMT/UTC date/time

&reftitle.description; `string` `gmdate` `string` `format` ``int``null```timestamp`&null;

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

&reftitle.parameters;

`format`

- The format of the outputted date `string`. See the formatting options for the `date` function.

&date.timestamp.description;
&reftitle.returnvalues;

Returns a formatted date string.

&reftitle.changelog;

&Version; | &Description;
8.0.0 | `timestamp` is nullable now.

&reftitle.examples;

### `gmdate` example

When run in Finland (GMT +0200), the first line below prints "Jan 01 1998 00:00:00", while the second prints "Dec 31 1997 22:00:00".

    <?php
    echo date("M d Y H:i:s", mktime(0, 0, 0, 1, 1, 1998));
    echo gmdate("M d Y H:i:s", mktime(0, 0, 0, 1, 1, 1998));
    ?>

&reftitle.seealso;

- `DateTimeImmutable::__construct`
- `DateTimeInterface::format`
- `date`
- `mktime`
- `gmmktime`
- `IntlDateFormatter::format`