Skip to content

Commit

Permalink
Fixing a timezone issue
Browse files Browse the repository at this point in the history
  • Loading branch information
dben committed Dec 12, 2023
1 parent afcb32c commit 1e95393
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions src/Ombi.Store/Context/Postgres/PostgresModuleInitializer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
using System;
using System.Runtime.CompilerServices;

namespace Ombi.Store.Context.Postgres;

public static class PostgresModuleInitializer
{
#pragma warning disable CA2255
// This is required to ensure that Npgsql uses a timestamp behavior that does not require a timezone
// Reference: https://stackoverflow.com/a/73586129
[ModuleInitializer]
#pragma warning restore CA2255
public static void Initialize()
{
AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true);
}
}

0 comments on commit 1e95393

Please sign in to comment.