Skip to content

Modern Chrono DateTime ToOffset

Paul Squires edited this page Oct 19, 2026 · 1 revision

Home › Date and Time (Chrono) › Chrono Date and Time › DateTime.ToOffset

DateTime.ToOffset

Converts to another UTC offset, keeping the moment and changing the clock reading.

Syntax

DateTime.ToOffset( offMin )

Notes

  • convert

Examples

#import "std/chrono"
using chrono

dim as DateTime d = DateTime( 2026, 8, 13, 14, 30, 5, 123 )
dim as DateTime utc = d.WithOffset( 0 )

'' CONVERTS to another offset, keeping the MOMENT and changing the
'' fields -- the opposite of WithOffset
dim as DateTime plus1 = utc.ToOffset( 60 )

print plus1.Hour             '' 15 -- one hour later on the clock
print plus1.ToInstant( ).Ticks = utc.ToInstant( ).Ticks      '' -1 (true)

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

Clone this wiki locally