DateTimeZone.From
Creates a datetimezone from the given value.
Syntax
DateTimeZone.From(
    value as any,
    optional culture as text
) as datetimezone
Remarks
Returns a datetimezone value from the given value. An optional culture may also be provided (for example, "en-US").If the given value is null, DateTimeZone.From returns null. If the given value is datetimezone, value is returned. Values of the following types can be converted to a datetimezone value:      
- text: A- datetimezonevalue from textual representation. Refer to- DateTimeZone.FromTextfor details.
- date: A- datetimezonewith- valueas the date component,- 12:00:00 AMas the time component, and the offset corresponding the local time zone.
- datetime: A- datetimezonewith- valueas the datetime and the offset corresponding the local time zone.
- time: A- datetimezonewith the date equivalent of the OLE Automation Date of- 0as the date component,- valueas the time component, and the offset corresponding the local time zone.
- number: A- datetimezonewith the datetime equivalent of the OLE Automation Date expressed by- valueand the offset corresponding the local time zone.
value is of any other type, an error is returned.
Examples
Example #1
Convert <code>"2020-10-30T01:30:00-08:00"</code> to a <code>datetimezone</code> value.
DateTimeZone.From("2020-10-30T01:30:00-08:00")
Result:
#datetimezone(2020, 10, 30, 01, 30, 00, -8, 00)
Category
DateTimeZone