mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-05-16 04:59:34 +08:00
Update sqlite date expression
This commit is contained in:
parent
cfd87478cd
commit
131108e282
@ -878,11 +878,15 @@ namespace SqlSugar
|
||||
|
||||
public string GeDateFormat(string formatString, string value)
|
||||
{
|
||||
if (IsOracle()||IsPg())
|
||||
if (IsOracle() || IsPg())
|
||||
{
|
||||
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')";
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user