No strptime in Windows?

Thomas Wouters thomas at xs4all.net
Sat Jun 10 15:53:52 EDT 2000


On Sat, Jun 10, 2000 at 07:28:56PM +0000, david_ullrich at my-deja.com wrote:

>     The docs say that time.strptime may not be available
> on all platforms. It doesn't seem to be available under MS
> Windows. I don't see why not - there's nothing Windological
> about strptime but the same applies to the other time
> functions that _are_ included.

time.strptime() is only included if the underlying platform supplies it.
Apparently, the Windows platform does not. The issue is certainly not wether
the underlying OS is UNIXy enough: BSDI, which is derived fairly directly
from 'the' original UNIX, does not supply strptime(), so there is no
time.strptime() on that platform.

A replacement strptime() (probably based on the glibc sources)
has been fairly high on my wishlist, but fairly low on my TODO ;) I'm sure
it's quite a big and complicated piece of code :P

>     Also: Is Monday really day 0? I woulda thought
> Sunday was day 0. (Doesn't seem to matter in the
> subtract-five-hours thing, I get the same results
> either way. Evidently mktime() ignores the day-of-week
> if it's inconsistent with the day-of-month field?)

The strptime manpage on Linux says this:

              %w     weekday number  (0-6)  with  Sunday  as  the
                     first day of the week

But perhaps this is different on Windows ? :-)

-- 
Thomas Wouters <thomas at xs4all.net>

Hi! I'm a .signature virus! copy me into your .signature file to help me spread!




More information about the Python-list mailing list