A date and time, represented in Python by a datetime.datetime instance.
You can get a string representation of a
DateTimeField casting it directly:
str(obj) # obj = qs ? or qs ?
You’ll get result like this (in this example I use
datetime.datetime.now() since a
DateTimeField is represented by
datetime.datetime is the same behavior):
>>> now = datetime.datetime.now() >>> str(now) '2013-06-26 00:14:26.260524'
if you want less information or formatted in other mode you can use
strftime() function for format them. see:
>>> now.strftime('%Y-%m-%d %H:%M') '2013-06-26 00:14'