Table of contents
TOC
Collapse the table of content
Expand the table of content

DateTimeZone.From

Owen Duncan|Last Updated: 10/5/2018
|
1 Contributor

About

Returns a datetimezone value from a value.

DateTimeZone.From(value as any, optional culture as nullable text) as nullable datetimezone  

Arguments

ArgumentDescription
valueValue to convert.
optional cultureA text value corresponding to the culture values supported on your version of Windows, such as "en-US". If the culture is not specified, the current user culture is used. For a list of culture names, see National Language Support (NLS) API Reference.

Type to convert

TypeDescription
textReturns a datetimezone value from a text value. For more details, see DateTimeZone.FromText.
dateA datetimezone with value as the date component, 12:0:00 AM as the time component and the offset corresponding the local time zone.
datetimeA datetimezone with value as the datetime and the offset corresponding the local time zone.
timeA datetimezone with the date equivalent of the OLE Automation Date of 0 as the date component, value as the time component and the offset corresponding the local time zone.
numberA datetimezone with the datetime equivalent the OLE Automation Date expressed by value and the offset corresponding the local time zone.
any other typeAn Expression.Error is thrown.

Remarks

  • If a value is null, DateTimeZone.From returns null.

  • If a value is datetimezone , the same value is returned.

Example

DateTimeZone.From("2020-10-30T01:30:00-08:00") equals #datetimezone(2020, 10, 30, 01, 30, 00, -8, 00)

© 2018 Microsoft