[Tutor] Through a glass, darkly: the datetime module
Richard D. Moores
rdmoores at gmail.com
Sun Oct 7 03:13:35 CEST 2012
On Sat, Oct 6, 2012 at 4:35 PM, Alan Gauld <alan.gauld at btinternet.com> wrote:
> On 07/10/12 00:19, Richard D. Moores wrote:
>
>> That "1" means Tuesday, right? But how can I use calendar to print out
>> that word, "TUESDAY"?
>
>
> days = ("Monday",
> "Tuesday",
> "Wednesday",
> "Thursday",
> "Friday",
> "Saturday",
> "Sunday")
>
> print '2014/2/18 is: ', days[calendar.weekday(2014, 2, 18)]
I was thinking that that kind of thing would be built into calendar. Thanks.
Dick
More information about the Tutor
mailing list