Finding out the weekday

Jorge Godoy godoy at metalab.unc.edu
Wed Mar 26 01:05:08 CET 2003


"Mark McEahern" <marklists at mceahern.com> writes:

> [Jorge Godoy]
>> Is there any Python module that given a particular date it returns me
>> the day of the week? I'm needing it for some special calculations
>> involving dates... 
>
>   import time
>   weekday = time.localtime()[6]
>
> As help(time) says, Monday is 0.

Thanks. I had found this before posting... I told in the other message
that the calendar module seems more suitable for what I'm needing. 

I appreciated a lot your answer.

-- 
Godoy.     <godoy at metalab.unc.edu>




More information about the Python-list mailing list