DateTimeZone.From
This topic applies to the Power Query Formula Language which can be used with Power Query and Power BI Desktop to build queries that mashup data. See the list of function categories.
Returns a datetimezone value from a value.
DateTimeZone.From(value as any, optional culture as nullable text) as nullable datetimezone
| Argument | Description |
|---|---|
| value | Value to convert. |
| optional culture | A 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
| Type | Description |
|---|---|
| text | Returns a datetimezone value from a text value. For more details, see DateTimeZone.FromText. |
| date | A datetimezone with value as the date component, 12:0:00 AM as the time component and the offset corresponding the local time zone. |
| datetime | A datetimezone with value as the datetime and the offset corresponding the local time zone. |
| time | A 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. |
| number | A datetimezone with the datetime equivalent the OLE Automation Date expressed by value and the offset corresponding the local time zone. |
| any other type | An Expression.Error is thrown. |
If a value is null, DateTimeZone.From returns null.
If a value is datetimezone , the same value is returned.
DateTimeZone.From("2020-10-30T01:30:00-08:00") equals #datetimezone(2020, 10, 30, 01, 30, 00, -8, 00)
Show: