Skip to content

Modern Tz ZonedDateTime ToInstant

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

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

ZonedDateTime.ToInstant

Returns the moment a ZonedDateTime names.

Syntax

ZonedDateTime.ToInstant( ) as chrono.Instant

Notes

  • Instant.Invalid for an Invalid value.

Examples

#import "std/tz"
#import "std/tzdata"
#import "std/chrono"
using tz
dim as ZonedDateTime z = ZonedDateTime.FromInstant( chrono.Instant.ParseIso( "2025-07-04T16:00:00Z" ), TimeZone.FindById( "America/New_York" ) )
print z.ToInstant( ).ToIsoString( )      '' 2025-07-04T16:00:00Z

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

Clone this wiki locally