From ee4a2f81980fa5f0db763c6d3354c9f3001d6e35 Mon Sep 17 00:00:00 2001 From: MrFelna Date: Fri, 3 May 2024 15:57:04 +0100 Subject: [PATCH] Datetime fixes use cf_sql_timestamp instead of cf_sql_date use HH: instead of hh: otherwise "2024-01-01" -> "2024-01-01T12:00:00" compare default dates with dateCompare so that "2024-01-01" eq "2024-01-01 00:00:00" --- packages/dbgateways/BaseGateway.cfc | 2 +- packages/dbgateways/MSSQL2005Gateway.cfc | 12 ++++++------ packages/dbgateways/MSSQL2012Gateway.cfc | 12 ++++++------ packages/dbgateways/MSSQLGateway.cfc | 20 ++++++++++++-------- packages/dbgateways/MySQLGateway.cfc | 4 ++-- 5 files changed, 27 insertions(+), 23 deletions(-) diff --git a/packages/dbgateways/BaseGateway.cfc b/packages/dbgateways/BaseGateway.cfc index 436164ef1..5669fe296 100644 --- a/packages/dbgateways/BaseGateway.cfc +++ b/packages/dbgateways/BaseGateway.cfc @@ -58,7 +58,7 @@ - + diff --git a/packages/dbgateways/MSSQL2005Gateway.cfc b/packages/dbgateways/MSSQL2005Gateway.cfc index ef70c38d6..0764467be 100644 --- a/packages/dbgateways/MSSQL2005Gateway.cfc +++ b/packages/dbgateways/MSSQL2005Gateway.cfc @@ -44,8 +44,8 @@ DEFAULT NULL DEFAULT '#stVal.value#' - - DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"hh:mm:s")#' + + DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"HH:mm:s")#' DEFAULT #stVal.value# @@ -159,8 +159,8 @@ DEFAULT NULL DEFAULT '#stVal.value#' - - DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"hh:mm:s")#' + + DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"HH:mm:s")#' DEFAULT #stVal.value# @@ -298,8 +298,8 @@ DEFAULT NULL DEFAULT '#stVal.value#' - - DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"hh:mm:s")#' + + DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"HH:mm:s")#' DEFAULT #stVal.value# diff --git a/packages/dbgateways/MSSQL2012Gateway.cfc b/packages/dbgateways/MSSQL2012Gateway.cfc index dbab0b9bf..7c9651dbd 100644 --- a/packages/dbgateways/MSSQL2012Gateway.cfc +++ b/packages/dbgateways/MSSQL2012Gateway.cfc @@ -50,8 +50,8 @@ DEFAULT NULL DEFAULT '#stVal.value#' - - DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"hh:mm:s")#' + + DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"HH:mm:s")#' DEFAULT #stVal.value# @@ -171,8 +171,8 @@ DEFAULT NULL DEFAULT '#stVal.value#' - - DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"hh:mm:s")#' + + DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"HH:mm:s")#' DEFAULT #stVal.value# @@ -316,8 +316,8 @@ DEFAULT NULL DEFAULT '#stVal.value#' - - DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"hh:mm:s")#' + + DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"HH:mm:s")#' DEFAULT #stVal.value# diff --git a/packages/dbgateways/MSSQLGateway.cfc b/packages/dbgateways/MSSQLGateway.cfc index a6b47185f..96c43e168 100644 --- a/packages/dbgateways/MSSQLGateway.cfc +++ b/packages/dbgateways/MSSQLGateway.cfc @@ -9,7 +9,7 @@ - + @@ -129,8 +129,8 @@ DEFAULT NULL DEFAULT '#stVal.value#' - - DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"hh:mm:s")#' + + DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"HH:mm:s")#' DEFAULT #stVal.value# @@ -250,8 +250,8 @@ DEFAULT NULL DEFAULT '#stVal.value#' - - DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"hh:mm:s")#' + + DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"HH:mm:s")#' DEFAULT #stVal.value# @@ -395,8 +395,8 @@ DEFAULT NULL DEFAULT '#stVal.value#' - - DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"hh:mm:s")#' + + DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"HH:mm:s")#' DEFAULT #stVal.value# @@ -861,7 +861,11 @@ - + + + + + diff --git a/packages/dbgateways/MySQLGateway.cfc b/packages/dbgateways/MySQLGateway.cfc index 9625ec0e4..f5101a93d 100644 --- a/packages/dbgateways/MySQLGateway.cfc +++ b/packages/dbgateways/MySQLGateway.cfc @@ -129,8 +129,8 @@ DEFAULT NULL DEFAULT '#stVal.value#' - - DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"hh:mm:s")#' + + DEFAULT '#dateformat(stVal.value,"YYYY-MM-DD")#T#timeformat(stVal.value,"HH:mm:s")#' DEFAULT #stVal.value#