I need to convert a python object datetime.time
to an arrow object.
y = datetime.time()
>>> y
datetime.time(0, 0)
>>> arrow.get(y)
TypeError: Can't parse single argument type of '<type 'datetime.time'>'
Arrow follows a specific format, as specified in its documentation:
arrow.get('2013-05-11T21:23:58.970460+00:00')
you need to convert your datetime object to arrow-understandable format in order to be able to convert it to an arrow object. the codeblock below should work:
from datetime import datetime
import arrow
arrow.get(datetime.now())
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With