Quantcast
Channel: MySQL Forums - Connector/Python
Viewing all articles
Browse latest Browse all 384

Wrong date format in MYSQL after python insert (no replies)

$
0
0
Hi,

I have the following code in python to inset data in a MySql table:


sql = "INSERT INTO ap_temp_data (sensor, date, time, temp) VALUES (%s, %s, %s, %s)"
#temp_avalue=read_temp()
val = (sensor, time.strftime("%d.%m.%Y"), time.strftime("%H:%M:%S"), read_temp())
mycursor.execute(sql, val)
mydb.commit()



The problem is that the date for 22.01.2019 in MySql is like that: 2022-01-20

Any idea what is wrong ?

Viewing all articles
Browse latest Browse all 384

Trending Articles