1DATE_FORMAT(date, format)
2-- E.g.
3SELECT DATE_FORMAT(dateField, '%m/%d/%Y') FROM TableName;
4-- See https://www.mysqltutorial.org/mysql-date_format/ for available formats
1-- Converts 'dd.mm.yyyy' to date (my_date_col is VARCHAR)
2SELECT STR_TO_DATE(my_date_col,'%d.%m.%Y') AS my_strdate FROM my_table;
3-- Converts 'dd.mm.yyyy' to 'YYYY-MM-DD'
4SELECT DATE_FORMAT(STR_TO_DATE(my_date_col,'%d.%m.%Y'), '%Y-%m-%d') AS my_strdate
5 FROM my_table;
1cur.execute('''SELECT id,home,visitor,finalscorehome,finalscorevisitor,eldatetime FROM games where Month(eldatetime) = Month(%s) AND YEAR(eldatetime) = Year(%s) AND DAY(eldatetime) = DAY(%s)''',(gamedate.date(),gamedate.date(),gamedate.date()))
2