template::util::date::now_min_interval (public)
template::util::date::now_min_interval [ -clock clock ]
Defined in packages/acs-templating/tcl/date-procs.tcl
Create a new Date object for the current date and time with the default interval for minutes
- Switches:
- -clock (optional)
- time in seconds, if not specified, it uses current time
- Author:
- Walter McGinnis <wtem@olywa.net>
- Created:
- 2002-01-06
- Partial Call Graph (max 5 caller/called nodes):
- Testcases:
- date_minute_interval
Source code: if {$clock eq ""} { set clock [clock seconds] } set now [list] foreach v [clock format $clock -format "%Y %m %d %H %M %S"] { lappend now [util::trim_leading_zeros $v] } # # Get original minute value # set minute [lindex $now 4] # # Get interval definition for "minute" (e.g. 0 59 5) # lassign [defaultInterval minutes] min max interval for { set i $min } { $i <= $max } { incr i $interval } { if {$minute == $i} { break } elseif {$minute < $i} { set minute $i break } } # # Replace the minute value in the now list with new value # lset now 4 $minute return [create {*}$now]XQL Not present: Generic, PostgreSQL, Oracle