Forum Discussion
Anonymous
5 years agoNot applicable
Date value changes when transforming column type
I cannot figure out why changing a "DateTimeZone" column to type "Date" causes the date value to change. First I convert my UTC DateTime to IST DateTimeZone = Table.AddColumn(#"table from databa...
- Anonymous5 years ago
Ok... I tried using Date.From() but noticed in the doco it says:
- datetimezone: The date component of the local datetime equivalent of value.
..... So, it uses "local" datetime equivalent. Unsurprisingly, it gave me the same "error" as using Table.TransformColumnTypes
It didn't take long on the doco page, though, to find the answer: DateTimeZone.RemoveZone()
(then change column to "Date" format ๐)
= Table.AddColumn(#"Changed Type", "DateTimeFrom", each DateTimeZone.RemoveZone([IST Time2]), type datetime)
Anonymous
5 years agoNot applicable
Ok... I tried using Date.From() but noticed in the doco it says:
- datetimezone: The date component of the local datetime equivalent of value.
..... So, it uses "local" datetime equivalent. Unsurprisingly, it gave me the same "error" as using Table.TransformColumnTypes
It didn't take long on the doco page, though, to find the answer: DateTimeZone.RemoveZone()
(then change column to "Date" format ๐)
= Table.AddColumn(#"Changed Type", "DateTimeFrom", each DateTimeZone.RemoveZone([IST Time2]), type datetime)