xref: /PHP-8.0/ext/date/tests/strftime_basic.phpt (revision b5c7a83d)
1--TEST--
2Test strftime() function : basic functionality
3--FILE--
4<?php
5echo "*** Testing strftime() : basic functionality ***\n";
6
7date_default_timezone_set("Asia/Calcutta");
8// Initialise all required variables
9$format = '%b %d %Y %H:%M:%S';
10$timestamp = mktime(8, 8, 8, 8, 8, 2008);
11
12// Calling strftime() with all possible arguments
13var_dump( strftime($format, $timestamp) );
14
15// Calling strftime() with mandatory arguments
16var_dump( strftime($format) );
17
18?>
19--EXPECTF--
20*** Testing strftime() : basic functionality ***
21string(20) "Aug 08 2008 08:08:08"
22string(%d) "%s %d %d %d:%d:%d"
23