From a22c69dac9e39858256bf1ebed5538ac0b2fea40 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Sun, 26 Feb 2023 12:19:59 +0800 Subject: [PATCH] Update datetimeoffset pgsql --- .../PostgreSQL/SqlBuilder/PostgreSQLInsertBuilder.cs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLInsertBuilder.cs b/Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLInsertBuilder.cs index a14e9b234..da655c964 100644 --- a/Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLInsertBuilder.cs +++ b/Src/Asp.NetCore2/SqlSugar/Realization/PostgreSQL/SqlBuilder/PostgreSQLInsertBuilder.cs @@ -147,6 +147,10 @@ namespace SqlSugar return Convert.ToInt64(value); } } + else if (type == UtilConstants.DateTimeOffsetType) + { + return FormatDateTimeOffset(value); + } else if (type == UtilConstants.BoolType) { return value.ObjToBool() ? "1" : "0"; @@ -161,6 +165,10 @@ namespace SqlSugar } } } + public override string FormatDateTimeOffset(object value) + { + return "'" + ((DateTimeOffset)value).ToString("o") + "'"; + } } }