Power Query datetimezone type

deLockloire

Board Regular
Joined
Apr 4, 2008
Messages
116
Office Version
  1. 365
Platform
  1. Windows
Hi,

I have a query with a column that looks like this:

2024-02-26T14:17:42.676231+01:00

If I change it to datetimezone type, it recognizes the parts properly and changes the data to this:

2024. 02. 26. 14:17:43 +01:00

However, when I load it to a table, the result is this:

2024.02.26 14:17:43​

This data is clearly not adjusted for the timezone offset. How can I have PQ to add the timezone to the time so that the end result look like this:

2024.02.26 15:17:43​


Thanks,
deL
 

Excel Facts

Excel motto
Not everything I do at work revolves around Excel. Only the fun parts.
Okay, in the meantime, I found how to solve this. Firstly, I misunderstood how datetimezone type functions. What I really wanted (and only realized later) is to show everything in local time, which you can achieve by writing this line into your M formula:

VBA Code:
#"NAME_OF_THIS_STEP" = Table.AddColumn(#"NAME_OF_PREVIOUS_STEP", "NAME_OF_NEW_COLUMN", each DateTimeZone.ToLocal([NAME_OF_COLUMN_CONTAINING_DATETIMEZONE]))
 
Upvote 0
Solution

Forum statistics

Threads
1,223,904
Messages
6,175,295
Members
452,631
Latest member
a_potato

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top