Finding the format of my timestamp in Python
Question: My time format is screwy, but it seemed workable, as a string with the
following format:

    
    
    '47:37:00'
    

I tried to set a variable where:

    
    
    DT = '%H:%M:%S'
    

So I could find the difference between two times, but it's given me the
following error:

    
    
    ValueError: time data '47:37:00' does not match format '%H:%M:%S'
    

Is it possible there are more elements to my time stamps than I thought? Or
that it's formatted in minutes/seconds/milliseconds? I can't seem to find
documentation that would help me determine my time format so I could set DT
and do arithmetic on it.


Answer: It's because you set 47 to %H, that is not a proper value. Here is an example:

    
    
    import datetime
    
    dt = datetime.datetime.strptime('2016/07/28 12:37:00','%Y/%m/%d %H:%M:%S')
    
    print dt
    

Output: 2016-07-28 12:37:00

