mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-09-22 20:13:41 +08:00
Add ConnMoreSettings.DisableMillisecond
This commit is contained in:
@@ -11,6 +11,7 @@ namespace SqlSugar
|
||||
public bool IsWithNoLockQuery { get; set; }
|
||||
|
||||
public bool DisableNvarchar { get; set; }
|
||||
public bool DisableMillisecond { get; set; }
|
||||
public bool PgSqlIsAutoToLower = true;
|
||||
public int DefaultCacheDurationInSeconds { get; set; }
|
||||
public bool? TableEnumIsString { get; set; }
|
||||
|
@@ -95,7 +95,14 @@ namespace SqlSugar
|
||||
{
|
||||
date = Convert.ToDateTime("1900-1-1");
|
||||
}
|
||||
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
||||
if (this.Context.CurrentConnectionConfig?.MoreSettings?.DisableMillisecond == true)
|
||||
{
|
||||
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss") + "'";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
||||
}
|
||||
}
|
||||
else if (type.IsEnum())
|
||||
{
|
||||
|
@@ -51,7 +51,14 @@ namespace SqlSugar
|
||||
{
|
||||
date = Convert.ToDateTime("1900-1-1");
|
||||
}
|
||||
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
||||
if (this.Context.CurrentConnectionConfig?.MoreSettings?.DisableMillisecond == true)
|
||||
{
|
||||
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss") + "'";
|
||||
}
|
||||
else
|
||||
{
|
||||
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
||||
}
|
||||
}
|
||||
else if (type == UtilConstants.DateType && iswhere)
|
||||
{
|
||||
|
Reference in New Issue
Block a user