- Fixed bug #34087 for real.

This commit is contained in:
Derick Rethans 2005-08-25 09:46:31 +00:00
parent 23b729dc15
commit d468a854f9
4 changed files with 721 additions and 679 deletions

File diff suppressed because it is too large Load diff

View file

@ -831,7 +831,8 @@ iso8601nocolon = hour24lz minutelz secondlz;
/* Date formats */ /* Date formats */
americanshort = month "/" day; americanshort = month "/" day;
american = month "/" day "/" year; american = month "/" day "/" year;
iso8601dateslash = year4 "/" month "/" daylz "/"?; iso8601dateslash = year4 "/" monthlz "/" daylz "/"?;
dateslash = year4 "/" month "/" day;
gnudateshort = year "-" month "-" day; gnudateshort = year "-" month "-" day;
iso8601date = year4 "-" monthlz "-" daylz; iso8601date = year4 "-" monthlz "-" daylz;
pointeddate = day "." month "." year; pointeddate = day "." month "." year;
@ -1063,9 +1064,9 @@ relativetext = (reltextnumber space? reltextunit)+;
return TIMELIB_AMERICAN; return TIMELIB_AMERICAN;
} }
iso8601date | iso8601dateslash iso8601date | iso8601dateslash | dateslash
{ {
DEBUG_OUTPUT("iso8601date | iso8601dateslash"); DEBUG_OUTPUT("iso8601date | iso8601dateslash | dateslash");
TIMELIB_INIT; TIMELIB_INIT;
TIMELIB_HAVE_DATE(); TIMELIB_HAVE_DATE();
s->time->y = timelib_get_nr((char **) &ptr, 4); s->time->y = timelib_get_nr((char **) &ptr, 4);

View file

@ -831,7 +831,8 @@ iso8601nocolon = hour24lz minutelz secondlz;
/* Date formats */ /* Date formats */
americanshort = month "/" day; americanshort = month "/" day;
american = month "/" day "/" year; american = month "/" day "/" year;
iso8601dateslash = year4 "/" month "/" daylz "/"?; iso8601dateslash = year4 "/" monthlz "/" daylz "/"?;
dateslash = year4 "/" month "/" day;
gnudateshort = year "-" month "-" day; gnudateshort = year "-" month "-" day;
iso8601date = year4 "-" monthlz "-" daylz; iso8601date = year4 "-" monthlz "-" daylz;
pointeddate = day "." month "." year; pointeddate = day "." month "." year;
@ -1063,9 +1064,9 @@ relativetext = (reltextnumber space? reltextunit)+;
return TIMELIB_AMERICAN; return TIMELIB_AMERICAN;
} }
iso8601date | iso8601dateslash iso8601date | iso8601dateslash | dateslash
{ {
DEBUG_OUTPUT("iso8601date | iso8601dateslash"); DEBUG_OUTPUT("iso8601date | iso8601dateslash | dateslash");
TIMELIB_INIT; TIMELIB_INIT;
TIMELIB_HAVE_DATE(); TIMELIB_HAVE_DATE();
s->time->y = timelib_get_nr((char **) &ptr, 4); s->time->y = timelib_get_nr((char **) &ptr, 4);

View file

@ -4,8 +4,17 @@ Bug #34087 (strtotime() does not work with date format "Y/m/d")
<?php <?php
date_default_timezone_set("UTC"); date_default_timezone_set("UTC");
echo "Y/m/d: ", strtotime("2005/8/12"), "\n"; echo "Y/m/d: ", strtotime("2005/8/12"), "\n";
echo "Y-m-d: ", strtotime("2005-8-12"); echo "Y-m-d: ", strtotime("2005-8-12"), "\n";
echo date(DATE_ISO8601, strtotime("2005/1/2")), "\n";
echo date(DATE_ISO8601, strtotime("2005/01/02")), "\n";
echo date(DATE_ISO8601, strtotime("2005/01/2")), "\n";
echo date(DATE_ISO8601, strtotime("2005/1/02")), "\n";
?> ?>
--EXPECT-- --EXPECT--
Y/m/d: 1123804800 Y/m/d: 1123804800
Y-m-d: 1123804800 Y-m-d: 1123804800
2005-01-02T00:00:00+0000
2005-01-02T00:00:00+0000
2005-01-02T00:00:00+0000
2005-01-02T00:00:00+0000