zeek/scripts/base/utils/time.zeek
2019-04-11 21:12:40 -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);
}