In [ ]:
from datetime import datetime
In [ ]:
local = datetime.now()
In [ ]:
local.strftime('%Y-%m-%d %H:%M:%S')
In [ ]:
local.isoformat()
In [ ]:
import arrow
In [ ]:
local = arrow.now()
In [ ]:
local.strftime('%Y-%m-%d %H:%M:%S')
In [ ]:
local.isoformat()
In [ ]:
before = arrow.now()
In [ ]:
after = arrow.now()
In [ ]:
after - before
In [ ]:
pacific = arrow.utcnow().to('US/Pacific')
In [ ]:
print(pacific.isoformat())
In [ ]:
pacific = arrow.now().to('US/Pacific')
In [ ]:
print(pacific.isoformat())
In [ ]:
arrow.get(1479149518)
In [ ]:
arrow.get('1479149518')
In [ ]:
arrow.get('2016-11-14 18:51:58')
In [ ]:
arrow.get('11/14/2016 18:51:58', 'MM/DD/YYYY HH:mm:ss')
In [ ]:
local = arrow.now()
local
In [ ]:
local.replace(second=0, microsecond=0)
In [ ]:
local.replace(seconds=1, microsecond=0)
In [ ]:
local.replace(days=-7)
In [ ]:
arrow.now().humanize()
In [ ]:
past = arrow.now().replace(hours=-1)
In [ ]:
past.humanize()
In [ ]:
past = arrow.now().replace(years=-1)
In [ ]:
past.humanize()
In [ ]:
future = arrow.now().replace(hours=2)
In [ ]:
future.humanize()
In [ ]:
future.humanize(locale='es')
In [ ]:
arrow.now().span('hour')
In [ ]:
start = arrow.now()
end = start.replace(minutes=3)
[r for r in arrow.Arrow.range('minute', start, end)]
In [ ]:
[r for r in arrow.Arrow.sparange('minute', start, end)]