lc_time_conn_to_system (public)

 lc_time_conn_to_system time_value

Defined in packages/acs-lang/tcl/localization-procs.tcl

Converts a date from the connection's timezone to the system (database) timezone, using the OpenACS timezone setting and user's preference

Parameters:
time_value - Timestamp from conn input in the ISO datetime format.
Returns:
Timestamp in the database's timezone, also in ISO datetime format.

Partial Call Graph (max 5 caller/called nodes):
%3 test_lang_test__lc_procs lang_test__lc_procs (test acs-lang) lc_time_conn_to_system lc_time_conn_to_system test_lang_test__lc_procs->lc_time_conn_to_system lang::conn::timezone lang::conn::timezone (public) lc_time_conn_to_system->lang::conn::timezone lang::system::timezone lang::system::timezone (public) lc_time_conn_to_system->lang::system::timezone lc_time_tz_convert lc_time_tz_convert (public) lc_time_conn_to_system->lc_time_tz_convert calendar::item::edit calendar::item::edit (public) calendar::item::edit->lc_time_conn_to_system calendar::item::new calendar::item::new (public) calendar::item::new->lc_time_conn_to_system packages/calendar/www/view-week-display.tcl packages/calendar/ www/view-week-display.tcl packages/calendar/www/view-week-display.tcl->lc_time_conn_to_system

Testcases:
lang_test__lc_procs
Source code:
    if { ![ns_conn isconnected] } {
        return $time_value
    }

    set system_tz [lang::system::timezone]
    set conn_tz [lang::conn::timezone]

    if { $conn_tz eq "" || $system_tz eq $conn_tz } {
        return $time_value
    }

    return [lc_time_tz_convert -from $conn_tz -to $system_tz -time_value $time_value]
XQL Not present:
PostgreSQL, Oracle
Generic XQL file:
packages/acs-lang/tcl/localization-procs.xql

[ hide source ] | [ make this the default ]
Show another procedure: