BE/PLG: TZ timestamp work #1251

Signed-off-by: jokob-sk <jokob.sk@gmail.com>
This commit is contained in:
jokob-sk
2025-11-04 19:24:13 +11:00
parent 6dd7251c84
commit 59477e7b38
67 changed files with 164 additions and 133 deletions

View File

@@ -23,7 +23,7 @@ from const import confFileName, logPath
from plugin_utils import getPluginObject
from plugin_helper import Plugin_Objects
from logger import mylog, Logger
from helper import timeNowTZ, get_setting_value, bytes_to_string, \
from helper import timeNowDB, get_setting_value, bytes_to_string, \
sanitize_string, normalize_string
from database import DB, get_device_stats
@@ -567,7 +567,7 @@ def prepTimeStamp(datetime_str):
except ValueError:
mylog('verbose', [f"[{pluginName}] Timestamp conversion failed of string '{datetime_str}'"])
# Use the current time if the input format is invalid
parsed_datetime = timeNowTZ() # Assuming this function returns the current time with timezone
parsed_datetime = timeNowDB()
# Convert to the required format with 'T' between date and time and ensure the timezone is included
return parsed_datetime.isoformat() # This will include the timezone offset