Hi,
I have this (after insertion) in my SQL table :
(1, datetime.datetime(2019, 5, 17, 17, 16, 14),
(2, datetime.datetime(2019, 5, 17, 17, 16, 47),
(3, datetime.datetime(2019, 5, 17, 17, 17, 18)
Why datetime.datetime is in my table and not only date !!! But when I print "now" variable i have only the date without dateime.datetime
But look my code (creation of the table)
cursor.execute("""
CREATE TABLE IF NOT EXISTS TableName (
id INT AUTO_INCREMENT PRIMARY KEY,
date DATETIME
);
""")
i use this line to take the date (was with datetime classe before but change nothing for my problem)
now = time.strftime("%Y-%m-%d %H:%M:%S")
Code of insertion
cursor.execute("""INSERT INTO TableName (date) VALUES(%s)""", (now))