mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-31 15:56:25 +08:00
Time configuration
This commit is contained in:
parent
9a806b1b74
commit
1ba4ff0066
@ -190,9 +190,9 @@ namespace SqlSugar
|
||||
if (type == UtilConstants.DateType)
|
||||
{
|
||||
var date = value.ObjToDate();
|
||||
if (date < Convert.ToDateTime("1900-1-1"))
|
||||
if (date < UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig))
|
||||
{
|
||||
date = Convert.ToDateTime("1900-1-1");
|
||||
date = UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig);
|
||||
}
|
||||
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
||||
}
|
||||
|
@ -292,9 +292,9 @@ namespace SqlSugar
|
||||
if (type == UtilConstants.DateType)
|
||||
{
|
||||
var date = value.ObjToDate();
|
||||
if (date < Convert.ToDateTime("1900-1-1"))
|
||||
if (date < UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig))
|
||||
{
|
||||
date = Convert.ToDateTime("1900-1-1");
|
||||
date = UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig);
|
||||
}
|
||||
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
||||
}
|
||||
|
@ -52,9 +52,9 @@ namespace SqlSugar
|
||||
if (type == UtilConstants.DateType)
|
||||
{
|
||||
var date = value.ObjToDate();
|
||||
if (date < Convert.ToDateTime("1900-1-1"))
|
||||
if (date < UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig))
|
||||
{
|
||||
date = Convert.ToDateTime("1900-1-1");
|
||||
date = UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig);
|
||||
}
|
||||
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
||||
}
|
||||
|
@ -45,9 +45,9 @@ namespace SqlSugar
|
||||
if (type == UtilConstants.DateType)
|
||||
{
|
||||
var date = value.ObjToDate();
|
||||
if (date < Convert.ToDateTime("1900-1-1"))
|
||||
if (date < UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig))
|
||||
{
|
||||
date = Convert.ToDateTime("1900-1-1");
|
||||
date = UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig);
|
||||
}
|
||||
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
||||
}
|
||||
|
@ -107,9 +107,9 @@ namespace SqlSugar
|
||||
if (type == UtilConstants.DateType)
|
||||
{
|
||||
var date = value.ObjToDate();
|
||||
if (date < Convert.ToDateTime("1900-1-1"))
|
||||
if (date < UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig))
|
||||
{
|
||||
date = Convert.ToDateTime("1900-1-1");
|
||||
date = UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig);
|
||||
}
|
||||
return "'" + date.ToString("yyyy-MM-dd HH:mm:ss.fff") + "'";
|
||||
}
|
||||
|
@ -117,9 +117,9 @@ namespace SqlSugar
|
||||
if (type == UtilConstants.DateType)
|
||||
{
|
||||
var date = value.ObjToDate();
|
||||
if (date < Convert.ToDateTime("1900-1-1"))
|
||||
if (date < UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig))
|
||||
{
|
||||
date = Convert.ToDateTime("1900-1-1");
|
||||
date = UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig);
|
||||
}
|
||||
if (this.Context.CurrentConnectionConfig?.MoreSettings?.DisableMillisecond == true)
|
||||
{
|
||||
|
@ -53,9 +53,9 @@ namespace SqlSugar
|
||||
if (type == UtilConstants.DateType)
|
||||
{
|
||||
var date = value.ObjToDate();
|
||||
if (date < Convert.ToDateTime("1900-1-1"))
|
||||
if (date < UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig))
|
||||
{
|
||||
date = Convert.ToDateTime("1900-1-1");
|
||||
date = UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig);
|
||||
}
|
||||
if (this.Context.CurrentConnectionConfig?.MoreSettings?.DisableMillisecond == true)
|
||||
{
|
||||
|
@ -141,7 +141,7 @@ namespace SqlSugar
|
||||
var date = Convert.ToDateTime(sqlParameter.Value);
|
||||
if (date==DateTime.MinValue)
|
||||
{
|
||||
sqlParameter.Value = Convert.ToDateTime("1753/01/01");
|
||||
sqlParameter.Value =UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig);
|
||||
}
|
||||
}
|
||||
if (parameter.Direction == 0)
|
||||
|
@ -91,9 +91,9 @@ namespace SqlSugar
|
||||
if (type == UtilConstants.DateType)
|
||||
{
|
||||
var date = value.ObjToDate();
|
||||
if (date < Convert.ToDateTime("1900-1-1"))
|
||||
if (date < UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig))
|
||||
{
|
||||
date = Convert.ToDateTime("1900-1-1");
|
||||
date = UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig);
|
||||
}
|
||||
if (this.Context.CurrentConnectionConfig?.MoreSettings?.DisableMillisecond == true)
|
||||
{
|
||||
|
@ -47,9 +47,9 @@ namespace SqlSugar
|
||||
if (type == UtilConstants.DateType && iswhere == false)
|
||||
{
|
||||
var date = value.ObjToDate();
|
||||
if (date < Convert.ToDateTime("1900-1-1"))
|
||||
if (date < UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig))
|
||||
{
|
||||
date = Convert.ToDateTime("1900-1-1");
|
||||
date = UtilMethods.GetMinDate(this.Context.CurrentConnectionConfig);
|
||||
}
|
||||
if (this.Context.CurrentConnectionConfig?.MoreSettings?.DisableMillisecond == true)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user