Forum Discussion
sgandla
Advocate I
8 years agoBinary timestamp converstion issues
Hi All, My xml has Date format in the form of 6.35912E+17 , When i import xml in Power BI Desktop and try to change the Date format as [mm/dd/yyyy] it gets converted to Error. Within the XML dat...
v-qiuyu-msft
Community Support
8 years agoHi sgandla,
There’s isn’t a built-in way to do that. This .NET-specific serialization format is pretty complicated but you could look at its source code here and try to reimplement the logic as an M function.
For simple cases like this one, where there’s no timezone embedded, you can say something like
let
ConvertTimestamp = (ts) => #datetime(1, 1, 1, 0, 0, 0) + #duration(0, 0, 0, ts / 10000000)
in
ConvertTimestamp(635912639960000000)
Best Regards,
Qiuyun Yu