Update 人大金仓[SqlServer]

This commit is contained in:
sunkaixuan
2024-08-06 11:02:39 +08:00
parent 0f7b0dbe89
commit af4f323818

View File

@@ -73,7 +73,14 @@ namespace SqlSugar
object value = null; object value = null;
if (it.Value is DateTime) if (it.Value is DateTime)
{ {
value = ((DateTime)it.Value).ToString("O"); if (IsSqlServerModel())
{
value = ((DateTime)it.Value).ToString("yyyy-MM-dd HH:mm:ss.fff");
}
else
{
value = ((DateTime)it.Value).ToString("O");
}
} }
else if (it.Value is DateTimeOffset) else if (it.Value is DateTimeOffset)
{ {
@@ -98,6 +105,10 @@ namespace SqlSugar
} }
} }
private bool IsSqlServerModel()
{
return this.Context?.CurrentConnectionConfig?.MoreSettings?.DatabaseModel == DbType.SqlServer;
}
public override string FormatDateTimeOffset(object value) public override string FormatDateTimeOffset(object value)
{ {