zeek/scripts/base/utils/time.bro
2013-10-16 20:41:56 -05:00

8 lines
292 B
Text

## Given an interval, returns a string representing the minutes and seconds
## in the interval (for example, "3m34s").
function duration_to_mins_secs(dur: interval): string
{
local dur_count = double_to_count(interval_to_double(dur));
return fmt("%dm%ds", dur_count/60, dur_count%60);
}