diff --git a/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteUpdateBuilder.cs b/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteUpdateBuilder.cs index a82d5209c..b50677c51 100644 --- a/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteUpdateBuilder.cs +++ b/Src/Asp.Net/SqlSugar/Realization/Sqlite/SqlBuilder/SqliteUpdateBuilder.cs @@ -60,6 +60,10 @@ namespace SqlSugar return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'"; } } + else if (type == UtilConstants.DateTimeOffsetType) + { + return GetDateTimeOffsetString(value); + } else if (type == UtilConstants.DateType && iswhere) { var parameterName = this.Builder.SqlParameterKeyWord + name + i; @@ -97,5 +101,15 @@ namespace SqlSugar } } } + + private object GetDateTimeOffsetString(object value) + { + var date = UtilMethods.ConvertFromDateTimeOffset((DateTimeOffset)value); + if (date < UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig)) + { + date = UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig); + } + return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'"; + } } }