import cbor2 as cbor from datetime import date, timezone print (date.today()) # 2018-05-22 c1 = cbor.dumps(date.today(), timezone=timezone.utc, date_as_datetime=True) print (c1.hex()) # c074323031382d30352d32325430303a30303a30305a print (cbor.loads(c1)) # 2018-05-22 00:00:00+00:00 print (type(cbor.loads(c1))) #