Forum Discussion
Hamish
Cirrocumulus
May 10, 2010clock clicks -milliseconds overflow time?
Does anyone know what the overflow time on the F5 implementation of [clock clicks -milliseconds] is? The TCL docs don't say, but there's a posting from 2002 calling for it to be made a 64bit value to ...
Hexum_117235
Nimbostratus
Apr 10, 2013Greetings!
The problem is actual!
I try to generate rfc3339 compliant timestamp with millisecond precision. My TCL script produces expected result, while iRule with same code doesn't work correct.
BEGIN
set ::TIMEZONE "+4:00"
proc mstime {} {
set ms_since_epoch [clock milliseconds]; TCL 8.5+, don't supported by BIG-IP
set ms_since_epoch [clock clicks -milliseconds]; obsoleted version of command, which only available on BIG-IP
set msl [string length ${ms_since_epoch}]; calculate amount of ciphers
set seconds [string range ${ms_since_epoch} 0 [expr $msl - 4]]
set ms [string range ${ms_since_epoch} [expr $msl - 3] $msl]
set http_request_timestamp [clock format $seconds -format %Y-%m-%dT%k:%M:%S.${ms}${::TIMEZONE}]
}
puts [mstime]
END
Some extra examples:
Code: log "seconds after epoch: [clock seconds]"
Generated message: seconds after epoch: 1365594840
Code: log "milliseconds after epoch: [clock clicks -milliseconds]"
Generated message: milliseconds after epoch: -204759372
My TCL interpreter don't produce negative number by executing command [clock clicks -milliseconds]
I expect such behavior while iRule execution.
PS: do you know when custom procedures could be defined in iRules?
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
