I have a string which looks like:
dt_string='some_prefix/%Y-%m-%d/%H:%M/some_postfix'
I want to format this string with current date and time, so that it may look like 'some_prefix/2016-06-28/10:00/some_postfix'
But my problem is that the date pattes may not always be in %Y-%m-%d/%H:%M. It can be anything like %m-%d-%Y/%H:%M. I looked into datetime.datetime.strptime but it takes format as input. In my case, the format isn't fixed. Is there a function that can determine the date time format dynamically from the input string? Or shall I write a logic determine format, and then use datetime.datetime.strptime ?
