TABLE OF CONTENTS
::pwtk::time2s
SYNOPSIS
proc ::pwtk::time2s {opt {time {}}} {
USAGE
time2s ?-real? TIME
PURPOSE
Convert the time to seconds and round it to an integer, unless the -real option is specified.
OPTION
- -real ... return the converted time as a real number (without this option, the time is returned as an integer number)
ARGUMENT
- TIME -- the time to convert, specified as 1h, 1d... (see below). If TIME is specified without a unit, seconds are assumed.
Units of time ("*" implies any string, e.g., micro* matches microseconds):
- micro* = microseconds
- ms = milliseconds
- no unit specified = seconds
- m, min* = minutes
- h, H, hour* = hours
- d, D, day* = days
- w, W, week* = weeks
- M, month* = months
- y, Y, year* = years
SOURCE
return [expr [::pwtk::time2ms $opt $time]/1000] }