Is there any one liner method to convert datetime to simple tuple
>>> from datetime import datetime, timedelta
>>> new_date = datetime. today() + timedelta(12)
>>> new_date
datetime.datetime(2020, 5, 26, 13, 31, 36, 838650)
How do I convert new_date to tuple type.
This is what I have tried
tuple(new_date)
Traceback (most recent call last):
File "<pyshell#7>", line 1, in <module>
tuple(new_date)
TypeError: 'datetime.datetime' object is not iterable
Expected output :
>> (2020, 5, 26, 13, 31, 36, 838650)