Index: openacs-4/packages/acs-lang/tcl/localization-procs-oracle.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/localization-procs-oracle.xql,v diff -u -r1.3.26.2 -r1.3.26.3 --- openacs-4/packages/acs-lang/tcl/localization-procs-oracle.xql 26 Jan 2023 16:24:48 -0000 1.3.26.2 +++ openacs-4/packages/acs-lang/tcl/localization-procs-oracle.xql 21 Mar 2023 13:34:38 -0000 1.3.26.3 @@ -13,15 +13,4 @@ - - - - - begin - :1 := to_char(timezone.local_to_utc(timezone.get_id(:tz), to_date(:time_value, 'YYYY-MM-DD HH24:MI:SS')), 'YYYY-MM-DD HH24:MI:SS'); - end; - - - - Index: openacs-4/packages/acs-lang/tcl/localization-procs-postgresql.xql =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/acs-lang/tcl/localization-procs-postgresql.xql,v diff -u -r1.5.26.2 -r1.5.26.3 --- openacs-4/packages/acs-lang/tcl/localization-procs-postgresql.xql 26 Jan 2023 16:24:48 -0000 1.5.26.2 +++ openacs-4/packages/acs-lang/tcl/localization-procs-postgresql.xql 21 Mar 2023 13:34:38 -0000 1.5.26.3 @@ -11,13 +11,4 @@ - - - - - select to_char(timezone__convert_to_utc(timezone__get_id(:tz), :time_value), 'YYYY-MM-DD HH24:MI:SS') - - - - 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.17 -r1.29.2.18 --- openacs-4/packages/acs-lang/tcl/localization-procs.tcl 26 Jan 2023 16:24:48 -0000 1.29.2.17 +++ openacs-4/packages/acs-lang/tcl/localization-procs.tcl 21 Mar 2023 13:34:38 -0000 1.29.2.18 @@ -466,23 +466,22 @@ Converts a local time to a UTC time for the specified timezone. @param time_value Local time in the ISO datetime format, YYYY-MM-DD HH24:MI:SS - @param tz Timezone that must exist in tz_data table. + @param tz Valid timezone as supported by the Tcl Clock command or + must exist in tz_data table. @return UTC time. } { if { $tz eq "" } { set tz [lang::conn::timezone] } - set utc_time $time_value - ad_try { - set utc_time [db_exec_plsql local_to_utc {}] - } on error {errorMsg} { - ad_log Warning "lc_time_local_to_utc: Query exploded on time conversion to UTC, probably just an invalid date, $time_value: $errorMsg" - } + set utc_time [lc_time_tz_convert -from $tz -to UTC -time_value $time_value] if {$utc_time eq ""} { - # If no conversion possible, log it and assume local is as given (i.e. UTC) - ns_log Notice "lc_time_local_to_utc: Timezone adjustment in ad_localization.tcl found no conversion to local time for $time_value $tz" + # + # An empty result normally means a broken date or timezone. We + # throw a warning in this case. + # + ns_log warning "lc_time_local_to_utc: Timezone adjustment in ad_localization.tcl found no conversion to local time for $time_value $tz" } return $utc_time