How to read the Python tutorial?

Zeynel azeynel1 at gmail.com
Wed Nov 10 10:13:06 EST 2010


For instance, when the tutorial has http://docs.python.org/release/2.6/library/datetime.html

class datetime.datetime
A combination of a date and a time. Attributes: year, month, day,
hour, minute, second, microsecond, and tzinfo.

What does this mean? How do I use it?

For instance, I have a DateTimeProperty mDate that I get from a query
in Google App Engine. This mDate has value

mDATE = 2010-11-10 14:35:22.863000

But when I try

datetime.datetime.mDATE.toordinal())

I get AttributeError.

If I try something like

td = mDATE.seconds

in GAE development server I get

AttributeError: 'datetime.datetime' object has no attribute 'seconds'

What am I doing wrong? And how to understand this stuff so that I can
start using the language instead of trying to figure out types. Thanks
for your help.






More information about the Python-list mailing list