Why does datetime.now() not a string?


#1

I just wanna know why we don't use the apostrophes here in this situation. Someone please tell why!!


#2

Because it is a compound object...

from datetime import datetime
now = datetime.now()
print now
print type(now)
2016-08-28 22:15:33.703436
<type 'datetime.datetime'>
None

#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.