[Tutor] Re: Is it a weekend

Emile van Sebille emile@fenx.com
Tue, 17 Sep 2002 15:44:15 -0700


"Michael Montagne" <montagne@boora.com> wrote in message
news:20020917221312.GB30884@boora.com...
> Can python tell me if it is a weekend or not?  Holiday?


>>> import time
>>> time.localtime(time.time())
(2002, 9, 17, 15, 33, 11, 1, 260, 1)
>>> print time.localtime.__doc__
localtime([seconds]) ->
(tm_year,tm_mon,tm_day,tm_hour,tm_min,tm_sec,tm_wday,tm_
yday,tm_isdst)

Convert seconds since the Epoch to a time tuple expressing local time.
When 'seconds' is not passed in, convert the current time instead.
>>>


mxDateTime has Feasts, which covers some of the additional holidays, but
as there are different observances everywhere, you're not likely to find
any one module that covers them all the right way.

HTH,

--

Emile van Sebille
emile@fenx.com

---------