[Tutor] Through a glass, darkly: the datetime module

eryksun eryksun at gmail.com
Sun Oct 7 02:22:03 CEST 2012


On Sat, Oct 6, 2012 at 7:19 PM, Richard D. Moores <rdmoores at gmail.com> wrote:
>
> But now I'm thinking it would be handy to not only know that, say, 500
> days from today is 2014-02-18, but to know what day if the week that
> is.

    >>> from datetime import date
    >>> date(2014, 2, 18).strftime("%A")
    'Tuesday'

http://docs.python.org/library/datetime#strftime-and-strptime-behavior


More information about the Tutor mailing list