dt_hour_diff (public, deprecated)

 dt_hour_diff -start_time start_time -end_time end_time

Defined in packages/acs-datetime/tcl/acs-calendar-2-procs.tcl

Deprecated. Invoking this procedure generates a warning.

24-hour times input (23:00,02:00). This gives us the num of hours of difference, taking into account that if something goes until 5:01, it is one more hour long than if it goes until 5:00 DEPRECATED: this is really something one should do leveraging existing tcl capabilities. Plain clock idioms can do the same in a more generic and reliable way.

Switches:
-start_time
(required)
-end_time
(required)
See Also:
  • clock

Partial Call Graph (max 5 caller/called nodes):
%3 dt_widget_day dt_widget_day (public, deprecated) dt_hour_diff dt_hour_diff dt_widget_day->dt_hour_diff ad_log_deprecated ad_log_deprecated (public) dt_hour_diff->ad_log_deprecated

Testcases:
No testcase defined.
Source code:
ad_log_deprecated proc dt_hour_diff
    set start_hour [string trimleft [string range $start_time 0 1] 0]
    set end_hour [string trimleft [string range $end_time 0 1] 0]
    set end_minutes [string range $end_time 3 4]

    # Special case when the hour is exact
    if {$end_minutes eq "00" } {
        return [expr {$end_hour - $start_hour - 1}]
    } else {
        return [expr {$end_hour - $start_hour}]
    }
XQL Not present:
Generic
PostgreSQL XQL file:
packages/acs-datetime/tcl/acs-calendar-2-procs-postgresql.xql

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

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