Python Get Current Date & Time

September 4, 2017
datetime.datetime.now()

Get current datetime & time.

import datetime
datetime.datetime.now()

Get current time.

datetime.datetime.now().time()

Get current datetime & time in UTC.

datetime.datetime.utcnow()
This work is licensed under a
Creative Commons Attribution-NonCommercial 4.0 International License.