[Tutor] how to use the time module?

John Fabiani jfabiani at yolo.com
Fri Nov 5 08:46:48 CET 2004


On Thursday 04 November 2004 22:38, Lin Jin wrote:
> i am new to python.i want to know that,if i have a variable a,and i want to
> use the time module,the strftime method to output the weekday,how could i
> do that? i know that i should use the the "%A",but if i write a code like
>
> this:
> >>>time.strftime("%A",a).
>
> it is not working.anyone can help me solve this one?

Try using 
import calendar
today=weekday(year, month, day)
#remember that it will return a number - 0=Monday

John


More information about the Tutor mailing list