Zeiten besser dargestellt
Werte in europäisches System umgerechnet
This commit is contained in:
@@ -33,7 +33,7 @@ class WetterDB:
|
||||
conn.row_factory = sqlite3.Row
|
||||
cursor = conn.cursor()
|
||||
|
||||
time_threshold = (datetime.now() - timedelta(hours=hours)).strftime('%Y-%m-%d %H:%M:%S')
|
||||
time_threshold = int((datetime.now() - timedelta(hours=hours)).timestamp())
|
||||
|
||||
cursor.execute('''
|
||||
SELECT * FROM wetterdaten
|
||||
@@ -51,11 +51,11 @@ class WetterDB:
|
||||
conn = sqlite3.connect(self.db_file)
|
||||
cursor = conn.cursor()
|
||||
|
||||
time_threshold = (datetime.now() - timedelta(hours=hours)).strftime('%Y-%m-%d %H:%M:%S')
|
||||
time_threshold = int((datetime.now() - timedelta(hours=hours)).timestamp())
|
||||
|
||||
cursor.execute('''
|
||||
SELECT
|
||||
strftime('%Y-%m-%d %H:00:00', dateTime) as hour,
|
||||
strftime('%Y-%m-%d %H:00:00', datetime(dateTime, 'unixepoch', 'localtime')) as hour,
|
||||
SUM(rainRate) as total_rain
|
||||
FROM wetterdaten
|
||||
WHERE dateTime >= ?
|
||||
|
||||
Reference in New Issue
Block a user