calendar::to_sql_datetime (public, deprecated)

 calendar::to_sql_datetime -date date -time time [ -time_p time_p ]

Defined in packages/calendar/tcl/calendar-procs.tcl

Deprecated. Invoking this procedure generates a warning.

This takes two date chunks, one for date one for time, and combines them correctly. The issue here is the incoming format. date: ANSI SQL YYYY-MM-DD time: we return HH24. DEPRECATED: this api has been superseded by api in acs-templating.

Switches:
-date
(required)
-time
(required)
-time_p
(defaults to "1") (optional)
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) template::util::date::get_property template::util::date::get_property (public) calendar::to_sql_datetime calendar::to_sql_datetime calendar::to_sql_datetime->ad_log_deprecated calendar::to_sql_datetime->template::util::date::get_property

Testcases:
No testcase defined.
Source code:
ad_log_deprecated proc calendar::to_sql_datetime
    # Set the time to 0 if necessary
    if {!$time_p} {
        set hours 0
        set minutes 0
    } else {
        set hours [template::util::date::get_property hours $time]
        set minutes [template::util::date::get_property minutes $time]
    }

    set year [template::util::date::get_property year $date]
    set month [template::util::date::get_property month $date]
    set day [template::util::date::get_property day $date]

    # put together the timestamp
    return "$year-$month-$day $hours:$minutes"
Generic XQL file:
packages/calendar/tcl/calendar-procs.xql

PostgreSQL XQL file:
packages/calendar/tcl/calendar-procs-postgresql.xql

Oracle XQL file:
packages/calendar/tcl/calendar-procs-oracle.xql

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