Python Date and Time & Conditionals control

PPZ發表於2015-02-21

首先: from datetime import date time
現在時間: datetime.now()
例子:

from datetime import datetime
now = datetime.now()
print '%s/%s/%s %s:%s:%s' % (now.month, now.day, now.year,now.hour,now.minute,now.second)

輸出: 2/20/2015 17:43:1

boolean operators 順序: not is evaluated first; and is evaluated next; or is evaluated last.

相關文章