Finding out the weekday
Jorge Godoy
godoy at metalab.unc.edu
Tue Mar 25 19:05:08 EST 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