TimeZone
From Xojo Documentation
Class (inherits from Object)
New in 2019r2
Used to identify a time zone in relationship to a Date.
Properties | ||
|
Constructors | ||
|
Shared Methods | |
|
Notes
Use any valid timezone. A list of common time zones is available here.
Sample Code
Creates a DateTime for Berlin timezone that matches the local timezone's hours and minutes:
Convert a date in the local time zone to the GMT time zone:
Var date1 As DateTime = New DateTime(2021, 2, 1, 13, 0, 0, 0, TimeZone.Current)
Var gmt As New TimeZone(0) // Get GMT time zone
Var gmtDate As New DateTime(date1.SecondsFrom1970, gmt)
Var gmt As New TimeZone(0) // Get GMT time zone
Var gmtDate As New DateTime(date1.SecondsFrom1970, gmt)
See Also
DateTime class