Browse Source

Time function optimization

pull/11/head
sunkaixuna 3 years ago
parent
commit
71fd340f69
  1. 4
      Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs

4
Src/Asp.Net/SqlSugar/ExpressionsToSql/ResolveItems/MethodCallExpressionResolve.cs

@ -882,6 +882,10 @@ namespace SqlSugar
{
return $"to_char({value},'{formatString}') ";
}
else if (IsMySql()&& formatString == "yyyy-MM-dd")
{
return $"DATE_FORMAT({value}, '%Y-%m-%d')";
}
else if (formatString == "yyyy-MM-dd" && IsSqlServer())
{
return $"CONVERT(varchar(100),convert(datetime,{value}), 23)";

Loading…
Cancel
Save