Forum Discussion
Convert a columns of datatype datetimezone to datetime
Unsure if this is helpful to anyone. I was finding the solution getting the most kudos was substracting the timezone and this was the opposite of I wanted it. I ended up just making this stupidly long calculation instead:
if [DateTimeZone] is null then null else
DateTime.From(Text.BeforeDelimiter(Text.From([DateTimeZone], "en-AU"), "+"))
+
#duration(0,
Time.Hour(Time.From(Text.AfterDelimiter(Text.From([DateTimeZone], "en-AU"), "+"))),
Time.Minute(Time.From(Text.AfterDelimiter(Text.From([DateTimeZone], "en-AU"), "+"))),
Time.Second(Time.From(Text.AfterDelimiter(Text.From([DateTimeZone], "en-AU"), "+"))))
First part just makes sure the value isn't null.
Then it extracts the text before the delimiter "+" which in my case is the datetime, then adds the text after the "+" delimiter which is my timezone information.
Not exactly convient but does the job.
Don't forget to convert the column to a datetime once done.