Forum Discussion
Steds84_8430
Nimbostratus
Sep 15, 2009Clock add?
I am having trouble with the clock add function, could anyone give me an example has to how I would add a number of minutes to the current time
So far I have tried
set e [clock add [clock seconds] 10 minutes]
it returns an error : [invalid option "add" must be: clicks format scan seconds] [add]
that to me says that the add sub-function does not exist, yet the tcl reference says otherwise?
I am quite new to iRules and Tcl so any help would be appreciated, even if it means a work around.
Brett.
3 Replies
- hoolio
Cirrostratus
Hi Brett,
iRules use TCL v8.4.x (You can use [info tclversion] Click here to verify this).
clock add was added in 8.5 (v8.5 release notes Click here). For time deltas, it's probably easier to get the time in unix time (seconds since the 1 Jan 1970 epoch using [clock seconds]) and then just use expr (Click here) to do the calculations.
If that doesn't work for your scenario, can you elaborate on it?
Thanks,
Aaron - Steds84_8430
Nimbostratus
Thanks for the quick reply, Aaron. I was probably over complicating a little, using the clock add. The clock seconds and expr method should work just fine.
Thanks again,
Brett. - Stefan_Klotz
Cumulonimbus
Hi Aaron,
thank you from my side as well, I also had the same syntax error as mentioned by Brett and got it working now with the expr option.
Ciao Stefan :)
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects