DateTimeZone.ToRecord
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 record containing parts of a DateTime value.
DateTimeZone.ToRecord(dateTimeZone as datetimezone) as record
| Argument | Description |
|---|---|
| dateTimeZone | The DateTimeZone to convert. |
- If a portion of the DateTime value is not specified with date, time or timezone, the corresponding part in the output record is not present.
DateTime.ToRecord(DateTime.FromText("2011-02-02T11:56:02-08:00")) equals
Year = 2011, Month = 2, Day = 2,
Hour = 11, Minute = 56, Second = 2,
Hours = -8, Minutes = 0
]
DateTime.ToParts(DateTime.From("11:56:02-05"))
[
Time = [Hour = 11, Minute = 56, Second = 2],
Timezone = [Hours = -5]
]
Show: