bug report - time.strptime()

Jarkko Torppa torppa at polykoira.megabaud.fi
Tue May 23 09:10:29 EDT 2000


In article <8gcva8+a9aq at eGroups.com>, Kevin Ng wrote:
...
>Note the pattern is whenever the format string has no separation,
>then strptime always return a date tuple of Jan 0 !?

Here is the stripped down "guts" of strptime function:

if (!PyArg_ParseTuple(args, "s|s:strptime", &buf, &fmt))
    return NULL;
strptime(buf, fmt, &tm);
return tmtotuple(&tm);

So it is propably your C-librarys strptime() that is broken/weird

>My python version and platform :
>Python 1.5.2 (#3, Jan 20 2000, 15:59:17)  [GCC egcs-2.90.29 980515
>(egcs-1.0.3 re on linux2

Python 1.5.2 (#1, Jul  2 1999, 11:12:30)
 [GCC egcs-2.91.60 19981201 (egcs-1.1.1 release)] on netbsd1
>>> time.strptime('000201','%y%m%d')
(2000, 2, 1, 0, 0, 0, 6, 1, 0)
>>> time.strptime('20000201','%Y%m%d')
(2000, 2, 1, 0, 0, 0, 6, 1, 0)

-- 
 Jarkko Torppa                torppa at staff.megabaud.fi
  Megabaud Internet-palvelut



More information about the Python-list mailing list