Tuple to datetime object
Question: I have a tuple that looks like this

    
    
    (datetime.datetime(2015, 8, 25, 14, 8, 56),)
    

And I want to convert it to a datetime object, in python?

How can I do this?

I have tried

    
    
    import datetime
    
    time = datetime.datetime(my_tuple)
    

Bu that didn't work.


Answer: Just get the first element of the tuple, which is a `datetime` object already.

    
    
    time = my_tuple[0]
    

