template::util::date::now_min_interval_plus_hour (public, deprecated)

 template::util::date::now_min_interval_plus_hour [ -clock clock ]

Defined in packages/acs-templating/tcl/date-procs.tcl

Deprecated. Invoking this procedure generates a warning.

Create a new Date object for the current date and time plus one hour with the default interval for minutes.

Switches:
-clock (optional)
time in seconds, if not specified, it uses current time Deprecated: as of 2019-04-25, no upstream code is making use of this proc and more generic alternatives exist.
Author:
Walter McGinnis <wtem@olywa.net>
Created:
2002-01-06
See Also:

Partial Call Graph (max 5 caller/called nodes):
%3 ad_log_deprecated ad_log_deprecated (public) template::util::date::create template::util::date::create (public) template::util::date::defaultInterval template::util::date::defaultInterval (public) util::trim_leading_zeros util::trim_leading_zeros (public) template::util::date::now_min_interval_plus_hour template::util::date::now_min_interval_plus_hour template::util::date::now_min_interval_plus_hour->ad_log_deprecated template::util::date::now_min_interval_plus_hour->template::util::date::create template::util::date::now_min_interval_plus_hour->template::util::date::defaultInterval template::util::date::now_min_interval_plus_hour->util::trim_leading_zeros

Testcases:
No testcase defined.
Source code:
ad_log_deprecated proc template::util::date::now_min_interval_plus_hour
    if {$clock eq ""} {
        set clock [clock seconds]
    }
    #
    # Add one hour to the clock
    #
    incr clock [expr {60*60}]

    set now [list]
    foreach v [clock format $clock -format "%Y %m %d %H %M %S"] {
        lappend now [util::trim_leading_zeros $v]
    }

    # manipulate the minute value so it rounds up to nearest minute interval
    set minute [lindex $now 4]
    # there is a definition for minute interval: 0 59 5
    lassign [defaultInterval minutes] min max inc
    for {set i $min} {$i <= $max} {incr i $inc} {
        if {$minute == $i} {
            break
        } elseif {$minute < $i} {
            set minute $i
            break
        }
    }

    return [create {*}$now]
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: