We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent acb9cae commit 3ff606aCopy full SHA for 3ff606a
ChangeLog.TODO
@@ -15,10 +15,6 @@ over to PHP4.
15
- PUT method support (mlemos@acm.org)
16
- Fix parameter count problem in odbc_setoption()
17
- Really fix implode() this time. The fix in 3.0.7 was bogus
18
-- Added more option to the date() function: (Colin Viebrock)
19
- 'g' - hour, 12-hour format, no leading zeros
20
- 'G' - hour, 24-hour format, no leading zeros
21
- 'n' - month, numeric, no leading zeros
22
- Make fgetss() slightly smarter
23
- Add strip_tags() which uses the fgetss state-machine but acts on a string
24
ext/standard/datetime.c
@@ -193,6 +193,7 @@ _php3_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
193
break;
194
case 'y': /* year, numeric, 2 digits */
195
case 'm': /* month, numeric */
196
+ case 'n': /* month, numeric, no leading zeroes */
197
case 'd': /* day of the month, numeric */
198
case 'j': /* day of the month, numeric, no leading zeros */
199
case 'H': /* hour, numeric, 24 hour format */
@@ -263,6 +264,10 @@ _php3_date(INTERNAL_FUNCTION_PARAMETERS, int gm)
263
264
sprintf(tmp_buff, "%02d", ta->tm_mon + 1); /* SAFE */
265
strcat(return_value->value.str.val, tmp_buff);
266
267
+ case 'n': /* month, numeric, no leading zeros */
268
+ sprintf(tmp_buff, "%d", ta->tm_mon + 1); /* SAFE */
269
+ strcat(return_value->value.str.val, tmp_buff);
270
+ break;
271
272
sprintf(tmp_buff, "%02d", ta->tm_mday); /* SAFE */
273
0 commit comments