mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-11-08 02:14:53 +08:00
Update sqlite date expression
This commit is contained in:
@@ -878,11 +878,15 @@ namespace SqlSugar
|
|||||||
|
|
||||||
public string GeDateFormat(string formatString, string value)
|
public string GeDateFormat(string formatString, string value)
|
||||||
{
|
{
|
||||||
if (IsOracle()||IsPg())
|
if (IsOracle() || IsPg())
|
||||||
{
|
{
|
||||||
return $"to_char({value},'{formatString}') ";
|
return $"to_char({value},'{formatString}') ";
|
||||||
}
|
}
|
||||||
else if (IsMySql()&& formatString == "yyyy-MM-dd")
|
else if (IsSqlite() && formatString == "yyyy-MM-dd")
|
||||||
|
{
|
||||||
|
return $"strftime('%Y-%m-%d', {value})";
|
||||||
|
}
|
||||||
|
else if (IsMySql() && formatString == "yyyy-MM-dd")
|
||||||
{
|
{
|
||||||
return $"DATE_FORMAT({value}, '%Y-%m-%d')";
|
return $"DATE_FORMAT({value}, '%Y-%m-%d')";
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user