You can't insert a DATE into a TIME column, you can't insert a TIME into a DATE column.cur.execute(" INSERT INTO data( name, value, mod_date) VALUES( 'temperature', temp_value, current_time )")Much appreciation from this Newbe!Code:
MariaDB [sensor1]> describe data;+----------+-------------+------+-----+---------+----------------+| Field | Type | Null | Key | Default | Extra |+----------+-------------+------+-----+---------+----------------+| id | int(11) | NO | PRI | NULL | auto_increment || name | varchar(50) | NO | | NULL | || value | varchar(50) | YES | | NULL | || mod_date | date | YES | | NULL | |+----------+-------------+------+-----+---------+----------------+
So with your current definition this SQL would work
Code:
cur.execute(" INSERT INTO data( name, value, mod_date) VALUES( 'temperature', temp_value, current_date )")Statistics: Posted by DougieLawson — Fri Sep 20, 2024 9:21 pm