datetime module usage

I forget a little every time and it's a syntax error so make a note

reference

http://docs.python.jp/2/library/datetime.html

Get the current time in UTC

now = datetime.datetime.utcnow()

Specify the specified date and time

the_day = datetime.datetime(2015, 6, 2, 21, 0, 0, 0)

Calculation

start = now - datetime.timedelta(days=96) Possible parameters are ([days, seconds, microseconds, milliseconds, minutes, hours, weeks])

Recommended Posts

datetime module usage
[Python] Class type and usage of datetime module
I tried using the Datetime module by Python