xref: /PHP-8.2/ext/date/tests/strftime_basic.phpt (revision 4b3615a3)
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 ***
21
22Deprecated: Function strftime() is deprecated in %s on line %d
23string(20) "Aug 08 2008 08:08:08"
24
25Deprecated: Function strftime() is deprecated in %s on line %d
26string(%d) "%s %d %d %d:%d:%d"
27