I have a datetime value which is made by strptime function
import MySQLdb
a = time.strptime('my date', "%b %d %Y %H:%M")
There is a column in MySql db of type DATETIME. When I try to insert this value into db, I, obviously, get the error of
mysql_exceptions.OperationalError: (1305, 'FUNCTION time.struct_time does not exist')
INSERT INTO myTable(Date......) VALUES(time.struct_time(tm_year=2222, tm_mon=4, tm_mday=1, tm_hour=1, tm_min=2, tm_sec=4, tm_wday=1, tm_yday=118, tm_isdst=-1), ......)
How can I insert this value into db?