From c69d3e6a6cb58cca2dabed06a076c5d387084c14 Mon Sep 17 00:00:00 2001 From: ceruIean Date: Fri, 25 Feb 2022 02:46:01 +0800 Subject: [PATCH] timezone fix --- Dockerfile | 3 --- Program.cs | 1 + 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index ee1d227..cb74ee3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,7 +21,4 @@ FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime -RUN echo 'Asia/Shanghai' >/etc/timezone - ENTRYPOINT ["dotnet", "2021-backend.dll"] \ No newline at end of file diff --git a/Program.cs b/Program.cs index 0cb0683..584e6c1 100644 --- a/Program.cs +++ b/Program.cs @@ -17,6 +17,7 @@ namespace _2021_backend public static void Main(string[] args) { + AppContext.SetSwitch("Npgsql.EnableLegacyTimestampBehavior", true); var host = CreateHostBuilder(args).Build(); using (var scope = host.Services.CreateScope())