python datetime format yyyy-mm-dd hh:mm:ss to yyyy-mm-dd date code example
Example: python date from yy/mm/dd to yy-mm-dd
lastconnection = datetime.strptime("21/12/2008", "%d/%m/%Y").strftime('%Y-%m-%d')
lastconnection = datetime.strptime("21/12/2008", "%d/%m/%Y").strftime('%Y-%m-%d')