Skip to content

Commit

Permalink
- 修复 MsAccess 日期问题;#1724 #1725
Browse files Browse the repository at this point in the history
  • Loading branch information
2881099 committed Jan 20, 2024
1 parent 3ca3391 commit cae8c36
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,13 @@ public override object AddslashesProcessParam(object param, Type mapType, Column
{
if (Utils.TypeHandlers.TryGetValue(typeof(DateTime), out var typeHandler)) return typeHandler.Serialize(param);
if (param.Equals(DateTime.MinValue) == true) param = new DateTime(1970, 1, 1);
return string.Concat("'", ((DateTime)param).ToString("yyyy-MM-dd HH:mm:ss"), "'");
return string.Concat("cdate('", ((DateTime)param).ToString("yyyy-MM-dd HH:mm:ss"), "')");
}
else if (param is DateTime?)
{
if (Utils.TypeHandlers.TryGetValue(typeof(DateTime?), out var typeHandler)) return typeHandler.Serialize(param);
if (param.Equals(DateTime.MinValue) == true) param = new DateTime(1970, 1, 1);
return string.Concat("'", ((DateTime)param).ToString("yyyy-MM-dd HH:mm:ss"), "'");
return string.Concat("cdate('", ((DateTime)param).ToString("yyyy-MM-dd HH:mm:ss"), "')");
}

else if (param is TimeSpan || param is TimeSpan?)
Expand Down

0 comments on commit cae8c36

Please sign in to comment.