diff --git a/weather/api.py b/weather/api.py index 9ef3dff..82d4b5e 100644 --- a/weather/api.py +++ b/weather/api.py @@ -11,7 +11,7 @@ bp = Blueprint('api', __name__) def api(): db = get_db() current_conditions = dict(db.execute( - "SELECT * FROM `current_forecasts` ORDER BY `end_time` DESC LIMIT 1" + "SELECT * FROM `current_forecasts` WHERE DATETIME('now', 'localtime') BETWEEN `start_time` AND `end_time` LIMIT 1" ).fetchone()) return current_conditions