Index: openacs-4/packages/acs-lang/tcl/localization-procs.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/localization-procs.tcl,v diff -u -r1.29.2.19 -r1.29.2.20 --- openacs-4/packages/acs-lang/tcl/localization-procs.tcl 21 Mar 2023 13:44:56 -0000 1.29.2.19 +++ openacs-4/packages/acs-lang/tcl/localization-procs.tcl 30 Jan 2024 14:21:25 -0000 1.29.2.20 @@ -558,20 +558,28 @@ @see https://www.tcl.tk/man/tcl/TclCmd/clock.html#M25 } { + # + # Here we enforce that the timestamp format is correct and + # apply Tcl clock date normalization (e.g. 2000-00-00 00:00:00 + # -> 1999-11-30 00:00:00) so that the behavior is consistent + # across DBMSs) + # + # Note that we support both the "short" e.g. "14:00" and "long" + # e.g. "14:00:01" time formats. + # try { - # - # Here we enforce that the timestamp format is correct and - # apply Tcl clock date normalization (e.g. 2000-00-00 00:00:00 - # -> 1999-11-30 00:00:00) so that the behavior is consistent - # across DBMSs) - # set clock_value [clock scan $time_value -format {%Y-%m-%d %H:%M:%S}] - set time_value [clock format $clock_value -format {%Y-%m-%d %H:%M:%S}] } on error {errmsg} { - ad_log warning "lc_time_tz_convert: invalid date '$time_value'" - return "" + try { + set clock_value [clock scan $time_value -format {%Y-%m-%d %H:%M}] + } on error {errmsg} { + ad_log warning "lc_time_tz_convert: invalid date '$time_value'" + return "" + } } + set time_value [clock format $clock_value -format {%Y-%m-%d %H:%M:%S}] + try { # # Tcl-based conversion