I have a datetime.datetime object. All I want to do is pull it’s data out and put it into a list. The only method I have found is:
date_list=list(my_dt_ob.timetuple())
This seems to be an awfully convoluted way of doing a conceptually simple thing. Anyone have a better way? Thanks.
Each of the parts of the date and time are available as attributes of the
datetimeobject. You can use them directly: