DateTimeZone.From

This function returns a DateTimeZone value based on the input provided. It is possible to specify an optional culture parameter (e.g. "en-US"). If the input value is null, the function will also retur...

Syntax

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

About

This function returns a DateTimeZone value based on the input provided. It is possible to specify an optional culture parameter (e.g. "en-US"). If the input value is null, the function will also return null. If the input value is already a DateTimeZone value, it will be returned as is. The function can convert values of different types into a DateTimeZone value: - text: Converts a textual representation of a DateTimeZone value. See DateTimeZone.FromText for more details. - date: Creates a DateTimeZone value with the input value as the date component, 12:00:00 AM as the time component, and the offset corresponding to the local time zone. - datetime: Generates a DateTimeZone value with the input value as the datetime and the offset corresponding to the local time zone. - time: Produces a DateTimeZone value with the date equivalent of the OLE Automation Date of 0 as the date component, the input value as the time component, and the offset corresponding to the local time zone. - number: Converts the input value

Explanation

Transform the string "2020-10-30T01:30:00-08:00" into a datetimezone value utilizing Power Query M function MDateTimeZone.From("2020-10-30T01:30:00-08:00"). The resulting output will be #datetimezone(2020, 10, 30, 01, 30, 00, -8, 00).