OpenBI Docs Buy

DateTimeZone.RemoveZone

Drops the offset of a datetimezone, keeping its clock time as a datetime.

Group: Dates and times. Power Query M has it too: a query that uses it is written as in Power BI.

Syntax

DateTimeZone.RemoveZone(dateTimeZone as nullable datetimezone) as nullable datetime
ParameterTypeDescription
dateTimeZonenullable datetimezoneThe value; null gives null.

Returns

nullable datetime. The same clock time without an offset.

Remarks

  • The clock time is kept as it is, not moved to UTC or to the computer's zone: switch zones first when the time should be read elsewhere.

Examples

A web shop's local time

DateTimeZone.RemoveZone(#datetimezone(2024, 3, 15, 14, 30, 0, 1, 0))
#datetime(2024, 3, 15, 14, 30, 0)

UTC first, then without the offset

DateTimeZone.RemoveZone(DateTimeZone.ToUtc(#datetimezone(2024, 3, 15, 14, 30, 0, 1, 0)))
#datetime(2024, 3, 15, 13, 30, 0)

DateTime.AddZone, DateTimeZone.ToUtc, DateTimeZone.SwitchZone.

Last updated · OpenBI Studio 0.3.79