Annotation of embedaddon/php/ext/date/tests/idate_variation4.phpt, revision 1.1.1.1
1.1 misho 1: --TEST--
2: Test idate() function : usage variation - Passing supported Date format characters to format argument.
3: --FILE--
4: <?php
5: /* Prototype : int idate(string format [, int timestamp])
6: * Description: Format a local time/date as integer
7: * Source code: ext/date/php_date.c
8: * Alias to functions:
9: */
10:
11: echo "*** Testing idate() : usage variation ***\n";
12:
13: // Initialise function arguments not being substituted (if any)
14: date_default_timezone_set("Asia/Calcutta");
15:
16: //array of values to iterate over
17: $inputs = array(
18:
19: 'Day of the month' => 'd',
20: 'Leap Year' =>'L',
21: 'Month number' => 'm',
22: 'Days in the month' => 't',
23: 'Day of the week' => 'w',
24: 'ISO-8601 week number' => 'W',
25: 'Year (1 or 2 digits)' => 'y',
26: 'Year 4 digits' => 'Y',
27: 'Day of the year' => 'z',
28: );
29:
30: // loop through each element of the array for timestamp
31: foreach($inputs as $key =>$value) {
32: echo "\n--$key--\n";
33: var_dump( idate($value) );
34: };
35: ?>
36: ===DONE===
37: --EXPECTF--
38: *** Testing idate() : usage variation ***
39:
40: --Day of the month--
41: int(%d)
42:
43: --Leap Year--
44: int(%d)
45:
46: --Month number--
47: int(%d)
48:
49: --Days in the month--
50: int(%d)
51:
52: --Day of the week--
53: int(%d)
54:
55: --ISO-8601 week number--
56: int(%d)
57:
58: --Year (1 or 2 digits)--
59: int(%d)
60:
61: --Year 4 digits--
62: int(%d)
63:
64: --Day of the year--
65: int(%d)
66: ===DONE===
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>