Convert string to date python yyyy-MM-DD code example
Example 1: python date from yy/mm/dd to yy-mm-dd
lastconnection = datetime.strptime("21/12/2008", "%d/%m/%Y").strftime('%Y-%m-%d')
Example 2: python timestamp to yyyy-mm-dd
import datetime as dt
dt.datetime.utcfromtimestamp(seconds_since_epoch).strftime("%Y/%m/%d %H:%M")