DateTimeZone.ToLocal Function in Power Query
The DateTimeZone.ToLocal function in Power Query returns a DateTime value from the local time zone.
Syntax
DateTimeZone.ToLocal(dateTimeZone as nullable datetimezone) as nullable datetimezone
Example:
Power Query M
let // Step 1: Create a table with datetimezone values Source = Table.FromRecords({ [Name = "Ashish", CreatedAt = #datetimezone(2025, 4, 10, 8, 30, 0, 3, 30)], [Name = "Ravi", CreatedAt = #datetimezone(2025, 4, 10, 12, 45, 0, 5, 30)], [Name = "Neha", CreatedAt = #datetimezone(2025, 4, 10, 14, 0, 0, 2, 0)] }), // Step 2: Get the value changed to local TimeZone value ZoneRemoved = Table.AddColumn(Source, "TransformedOutput", each DateTimeZone.ToLocal([CreatedAt])) in ZoneRemoved
The output of the above code is shown in the image below:
