From b0c4c9777f9574e9c2805fddc2a12576d75d94ce Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Fri, 9 Jan 2015 20:01:59 +0100 Subject: [PATCH] Added two new helpers date_comp, sql_date_comp. --- includes/date_functions.inc | 33 ++++++++++++++++++++++++++++++++- 1 file changed, 32 insertions(+), 1 deletion(-) diff --git a/includes/date_functions.inc b/includes/date_functions.inc index 4d0fd5f8..623452e2 100644 --- a/includes/date_functions.inc +++ b/includes/date_functions.inc @@ -421,6 +421,38 @@ and converts to a yyyy/mm/dd format */ return sprintf("%04d-%02d-%02d", $year, $month, $day); }// end of function +/** + * Compare dates in sql format. + * Return +1 if sql date1>date2, -1 if date1