Floor Timespan

Description

A simple function to round down a timespan, eliminating all decimals.

This snippet does not require an addon to function.

Snippet

function floorTimespan(time: timespan) :: timespan:
    set {_s} to join (regex split "%{_time}%" at "\.\d+")
    return {_s} parsed as timespan

Applications

Broadcasting a timespan without showing decimals.

set {_a} to "2 minutes and 37.49 seconds" parsed as timespan
broadcast floorTimespan({_a})

Output would be 2 minutes and 37 seconds.

Last updated