Make sure Job date times are stored in the database as UTC. This is required if using Postgres or you will get an exception with a message of “Cannot write DateTime with Kind=Unspecified to PostgreSQL type 'timestamp with time zone', only UTC is supported.”.

This commit is contained in:
Darryl Koehn
2022-09-07 12:46:24 -06:00
parent 62eca2aedc
commit ba97f63338
5 changed files with 130 additions and 62 deletions

View File

@ -17,7 +17,7 @@ namespace Oqtane.Infrastructure
Name = "Purge Job";
Frequency = "d"; // daily
Interval = 1;
StartDate = DateTime.ParseExact("03:00", "H:mm", null, System.Globalization.DateTimeStyles.None); // 3 AM
StartDate = DateTime.ParseExact("03:00", "H:mm", null, System.Globalization.DateTimeStyles.AssumeLocal).ToUniversalTime(); // 3 AM
IsEnabled = true;
}