Skip to content

Modern Tz ZonedDateTime Add

Paul Squires edited this page Nov 11, 2026 · 1 revision

Home › Time Zones › Time Zones (std/tz) › ZonedDateTime.Add

ZonedDateTime.Add

Adds elapsed time, whatever the clocks do meanwhile.

Syntax

ZonedDateTime.Add( byref s as chrono.TimeSpan ) as ZonedDateTime

Notes

  • Across a change of offset the wall-clock reading moves by more or less than the span. For "the same time tomorrow" use AddCalendarDays.

Examples

#import "std/tz"
#import "std/tzdata"
#import "std/chrono"
using tz
dim as TimeZone ny = TimeZone.FindById( "America/New_York" )
dim as ZonedDateTime m = ZonedDateTime.FromLocal( chrono.DateTime( 2025, 3, 8, 12, 0, 0, 0 ), ny )
print m.Add( chrono.TimeSpan.FromHours( 24 ) ).ToIsoString( )      '' 2025-03-09T13:00:00-04:00[America/New_York]

Library: Time Zones (std/tz)
Category: Time Zones
Documented under: ZonedDateTime

Clone this wiki locally