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