Skip to content

Modern Chrono TimeSpan Divide

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Date and Time (Chrono) › Chrono Date and Time › TimeSpan.Divide

TimeSpan.Divide

Returns the duration divided by a number, or Invalid when dividing by zero.

Syntax

TimeSpan.Divide( f )

Examples

#import "std/chrono"
using chrono

dim as TimeSpan t = TimeSpan( 1, 0, 0 )

print t.Divide( 2 ).ToIsoString( )       '' PT30M
print t.Divide( 4 ).ToIsoString( )       '' PT15M

'' Dividing by zero yields Invalid rather than raising or giving an
'' infinite span
print t.Divide( 0 ).IsValid              '' false

Library: Chrono Date and Time
Category: Date and Time (Chrono)
Documented under: The Members

Clone this wiki locally