From 94f8d545b9fd62f820cd9cfc597559d187350104 Mon Sep 17 00:00:00 2001 From: Sleevezipper Date: Sun, 12 Dec 2021 15:50:50 +0100 Subject: [PATCH] Format datetimes to ISO standard fix #145 --- hass-workstation-service/Domain/Sensors/LastActiveSensor.cs | 2 +- hass-workstation-service/Domain/Sensors/LastBootSensor.cs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/hass-workstation-service/Domain/Sensors/LastActiveSensor.cs b/hass-workstation-service/Domain/Sensors/LastActiveSensor.cs index 9aa38bc..9eba3b8 100644 --- a/hass-workstation-service/Domain/Sensors/LastActiveSensor.cs +++ b/hass-workstation-service/Domain/Sensors/LastActiveSensor.cs @@ -25,7 +25,7 @@ namespace hass_workstation_service.Domain.Sensors public override string GetState() { - return GetLastInputTime().ToString("s"); + return GetLastInputTime().ToString("o", System.Globalization.CultureInfo.InvariantCulture); } diff --git a/hass-workstation-service/Domain/Sensors/LastBootSensor.cs b/hass-workstation-service/Domain/Sensors/LastBootSensor.cs index fda171c..26b4896 100644 --- a/hass-workstation-service/Domain/Sensors/LastBootSensor.cs +++ b/hass-workstation-service/Domain/Sensors/LastBootSensor.cs @@ -29,10 +29,10 @@ namespace hass_workstation_service.Domain.Sensors public override string GetState() { - return (DateTime.Now - TimeSpan.FromMilliseconds(GetTickCount64())).ToString("s"); + return (DateTime.Now - TimeSpan.FromMilliseconds(GetTickCount64())).ToString("o", System.Globalization.CultureInfo.InvariantCulture); } [DllImport("kernel32")] extern static UInt64 GetTickCount64(); } -} +} \ No newline at end of file