From 2ab1210c78e12544ffa5d0ebea0023c0a982f299 Mon Sep 17 00:00:00 2001 From: sunkaixuan <610262374@qq.com> Date: Fri, 22 Nov 2024 11:56:22 +0800 Subject: [PATCH] Update HGDB --- .../HG/SqlBuilder/PostgreSQLExpressionContext.cs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/Src/Asp.NetCore2/SqlSugar.HG/HG/SqlBuilder/PostgreSQLExpressionContext.cs b/Src/Asp.NetCore2/SqlSugar.HG/HG/SqlBuilder/PostgreSQLExpressionContext.cs index 9c8e81ac4..e58375729 100644 --- a/Src/Asp.NetCore2/SqlSugar.HG/HG/SqlBuilder/PostgreSQLExpressionContext.cs +++ b/Src/Asp.NetCore2/SqlSugar.HG/HG/SqlBuilder/PostgreSQLExpressionContext.cs @@ -133,6 +133,20 @@ namespace SqlSugar.HG } public class HGMethod : DefaultDbMethod, IDbMethods { + + public override string GetDateString(string dateValue, string formatString) + { + if (!(formatString?.Contains("24") == true)) + { + formatString = formatString.Replace("HH", "hh24"); + if (!(formatString?.Contains("24") == true)) + { + formatString = formatString.Replace("hh", "hh24"); + } + } + formatString = formatString.Replace("mm", "mi"); + return $"to_char({dateValue},'{formatString}') "; + } public override string CharIndex(MethodCallExpressionModel model) { return string.Format(" (strpos ({1},{0})-1)", model.Args[0].MemberName, model.Args[1].MemberName);