Core: ScanWwwTime 2-digit year heuristics adjusted

git-svn-id: svn://ultimatepp.org/upp/trunk@7097 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-03-25 11:41:04 +00:00
parent 2a06d539c7
commit 6fe84c49b1

View file

@ -10,8 +10,6 @@ String WwwFormat(Time tm)
{
static const char *dayofweek[] =
{ "Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat" };
static const char *month[] =
{ "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" };
return String().Cat()
<< dayofweek[DayOfWeek(tm)] << ", "
<< (int)tm.day << ' ' << s_www_month[tm.month - 1]
@ -41,8 +39,11 @@ bool ScanWwwTime(const char *s, Time& tm)
return false;
tm.month = n;
tm.year = p.ReadInt(1, 4000);
if(tm.year < 100)
if(tm.year < 50)
tm.year += 2000;
else
if(tm.year < 100)
tm.year += 1900;
tm.hour = p.ReadInt(0, 23);
p.PassChar(':');
tm.minute = p.ReadInt(0, 59);