problems playing with dates from any month.

kyosohma at gmail.com kyosohma at gmail.com
Thu Aug 2 15:27:27 EDT 2007


On Aug 2, 1:16 pm, "krishnakant Mane" <researchb... at gmail.com> wrote:
> On 02/08/07, Ian Clark <icl... at mail.ewu.edu> wrote:
>
>
>
> >http://docs.python.org/lib/node85.html
>
> I looked there even before.
> but could not figure out what the code did.
> I know in that variable called s there was a string in a valid date format.
> but when datetime.strptime was used, I did not understand the place
> where a date object say d was created.
> I would expect some thing like d = and the function.  but I did not fine that.
> only reference was the datetime module and the documentation is not as good.
> another question I am getting is that where is the list of all
> formatting characters.  like for example Y is 4 digit year M is month
> MM is month in 2 digits etc.
> I am trying to locate a list of all these denoters.
> can you provide me the place?
>
> > Then it's just:
>
> > if date_obj.day == 5:
> >      print 'It's the fifth day of the month'
>
> this was much better than the documentation, thanks,
> regards,
> Krishnakant.

The various flags for the strftime() are here, near the middle of the
page: http://docs.python.org/lib/module-time.html

Not sure why the docs don't point to this page when talking about the
datetime's almost identical method.

Mike




More information about the Python-list mailing list