diff --git a/Src/Asp.Net/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpInsertBuilder.cs b/Src/Asp.Net/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpInsertBuilder.cs index 7fa11e3d1..044b7bd6d 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpInsertBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpInsertBuilder.cs @@ -97,5 +97,12 @@ namespace SqlSugar return batchInsetrSql.ToString(); } } + + + public override string FormatDateTimeOffset(object value) + { + var date = UtilMethods.ConvertFromDateTimeOffset((DateTimeOffset)value); + return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff zzz") + "'"; + } } } diff --git a/Src/Asp.Net/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpUpdateBuilder.cs b/Src/Asp.Net/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpUpdateBuilder.cs index 2230aa70b..6518a1565 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpUpdateBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Kdbndp/SqlBuilder/KdbndpUpdateBuilder.cs @@ -223,7 +223,8 @@ namespace SqlSugar } public override string FormatDateTimeOffset(object value) { - return "'" + ((DateTimeOffset)value).ToString("o") + "'"; + var date = UtilMethods.ConvertFromDateTimeOffset((DateTimeOffset)value); + return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff zzz") + "'"; } } }