Forum Discussion
dsabsi
9 years agoAdvocate I
How to convert text (data type) to a date (data type)?
Hello guys, I need your help with converting a text column towards a data type. Should i add a column with a certain formula to achieve this? See below the error that I'm getting from thi...
- 9 years ago
Sure (I included some Dutch as well :-) ):
let Source = #table(type table[Verwachte_Start = text],{{"1499032800"},{"1498860000"},{"1493589600"},{"1491170400"}}), AddedUTCDateTime = Table.AddColumn(Source, "Verwachte_startdatum/tijd_UTC", each #datetimezone(1970,1,1,0,0,0,0,0) + #duration(0,0,0,Number.From([Verwachte_Start])), type datetimezone), AddedLocalDate = Table.AddColumn(AddedUTCDateTime, "Verwachte_startdatum_lokaal", each Date.From([#"Verwachte_startdatum/tijd_UTC"]), type date) in AddedLocalDate
Anonymous
9 years agoNot applicable
- dsabsi9 years agoAdvocate I
Hi Guys AnonymousSivaManiMarcelBeugblopez11,
I found out that the text value is an epoch value in a text value.
Do you know how to convert an epoch value in a text format to dates value in date format?
Cheers,
DSabsi
- MarcelBeug9 years agoCommunity Champion
Sure (I included some Dutch as well :-) ):
let Source = #table(type table[Verwachte_Start = text],{{"1499032800"},{"1498860000"},{"1493589600"},{"1491170400"}}), AddedUTCDateTime = Table.AddColumn(Source, "Verwachte_startdatum/tijd_UTC", each #datetimezone(1970,1,1,0,0,0,0,0) + #duration(0,0,0,Number.From([Verwachte_Start])), type datetimezone), AddedLocalDate = Table.AddColumn(AddedUTCDateTime, "Verwachte_startdatum_lokaal", each Date.From([#"Verwachte_startdatum/tijd_UTC"]), type date) in AddedLocalDate- dsabsi9 years agoAdvocate I
Hi MarcelBeug,
Thank you for your answer (and of course in Dutch ;) I appreciate that.
Should I try your formula in a column or through edit-queries?
Cheers,
DSabsi