xref: /PHP-7.1/ext/date/tests/gmdate_basic.phpt (revision 7af945e2)
1--TEST--
2Test gmdate() function : basic functionality
3--FILE--
4<?php
5/* Prototype  : string gmdate(string format [, long timestamp])
6 * Description: Format a GMT date/time
7 * Source code: ext/date/php_date.c
8 * Alias to functions:
9 */
10
11echo "*** Testing gmdate() : basic functionality ***\n";
12
13// Initialise all required variables
14date_default_timezone_set('UTC');
15$format = DATE_ISO8601;
16$timestamp = mktime(8, 8, 8, 8, 8, 2008);
17
18// Calling gmdate() with all possible arguments
19var_dump( gmdate($format, $timestamp) );
20
21// Calling gmdate() with mandatory arguments
22var_dump( gmdate($format) );
23
24?>
25===DONE===
26--EXPECTF--
27*** Testing gmdate() : basic functionality ***
28string(24) "2008-08-08T08:08:08+0000"
29string(%d) "%s"
30===DONE===
31