Forum Discussion
NetSnoopy
Apr 26, 2017Cirrus
clock format from ISO8601 to numerical
Hello,
I have variable with a timestamp like this "2017-04-26T15:09:49.228Z" and I need to convert to numerical (just seconds).
I try
[clock format $nbf -format {%s}]
I get a TCL error "- expected integer but got "2017-04-26T15:09:49.228Z" while executing "clock format $nbf -format {%s}""
Have anyone a idea how I can solve this format problem?
- Stanislas_Piro2Cumulonimbus
Hi,
you can use this:
set time "2017-04-26T15:09:49.228Z" set time [string range $time 0 [string first "." $time]-1] clock scan $time -format {%Y-%m-%dT%H:%M:%S}
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