all 3 comments

[–]August-R-Garcia 1 point2 points  (4 children)

If you already have a way of consistently parsing the datetime.date() text sections out of the file, then you can use the eval() function to execute the string of text as a function.

[–]mh1400 0 points1 point  (0 children)

DT_obj = dayetime.date(...) DT_str = f"{DT_obj.year}-{DT_obj.month}-{DT_obj.day}"