Well, this indicates that the format of the date stored in the database has (for some reason) the wrong format. It is represented as dd.mm.yyyy instead of the required yyyy-mm-ddValueError: time data '25.03.2016 11:12' does not match format '%Y-%m-%d %H:%M'
I cannot see why this is stored wrong but try to run this script (edit it for the correct tableId) to check how the stored data looks like
Code: Select all
import sqlite3
def GetAllData(
dbName,
dbTableId
):
dbName = str(dbName)
conn = sqlite3.connect(dbName)
c = conn.cursor()
t = ((dbTableId),)
try:
print 'Export started, please wait...'
c.execute('SELECT * FROM '+dbName.split('.')[0]+' WHERE tableId=?', t)
coll = c.fetchall()
conn.close()
return coll
except:
conn.close()
return None
# edit this line with name of db and table id
rows = GetAllData('tempData.db', 'Temperature ground')
fileHandle = None
fileHandle = open('dbExport.txt', 'a')
for row in rows:
#print row
fileHandle.write(str(row)+'\r\n')
fileHandle.close()
print 'Export done'