Forum Discussion
Converting UTC to NZ standard time
Hi there,
I am trying to convert UTC datetime column into NZ standard time using following calculation in Power query:
DateTimeZone.SwitchZone([Outage Planned Start],12,0)
When I execute the command, it throws the following error and when I clicked on the error, it shows the following screen:
I am not sure how to fix the issue. Could anyone help me to fix the issue?
Hi Dunner2020
You need to supply a DateTimeZone value to DateTimeZone.Switch, you're only supplying a #datetime value
DateTimeZone.SwitchZone - PowerQuery M | Microsoft Docs
#datetimezone - PowerQuery M | Microsoft Docs
I'm confused, if you are supplying a #datetime value (presumably this is in the column?) why not just create/change the time to UTC directly? Why does your column have #datetime in it rather than actual DateTimeZone values?
Regards
Phil
1 Reply
- PhilipTreacy
Super User
Hi Dunner2020
You need to supply a DateTimeZone value to DateTimeZone.Switch, you're only supplying a #datetime value
DateTimeZone.SwitchZone - PowerQuery M | Microsoft Docs
#datetimezone - PowerQuery M | Microsoft Docs
I'm confused, if you are supplying a #datetime value (presumably this is in the column?) why not just create/change the time to UTC directly? Why does your column have #datetime in it rather than actual DateTimeZone values?
Regards
Phil