Forum Discussion
DateTime in Azure Cosmos DB
- 6 years ago
I was able to get a solution from the issue/idea I submitted.
let ConvertTimestamp = (ts) => #datetime(1, 1, 1, 0, 0, 0) + #duration(0, 0, 0, ts / 10000000) in ConvertTimestamp(635912639960000000)
Hi BenKoth
You can refer to this article to convert ISO format to date , and i have do a pbix for to to try.
here is pbix, the steps are in it.
Thanks. I don't think my data is actually in the ISO format like it claims. I don't know what format it is. Has anyone used the Azure Cosmos DB to get data that contains a date time?
My data is populated using the Azure Cosmos Table SDK, I wonder if that is where the disconnect is. You have to do some strange URL manipulation to change the table.cosmos to "documents" for the datasource URL.
- BenKoth6 years agoRegular Visitor
I had submitted a similar question on the Azure Cosmos Table SDK Github page and it looks like they are purposely storing this date in an unknown format. I'm guessing they aren't going to change the format so I'm going to submit an issue to Power BI to add the ability to convert this format to DateTime. For reference:
https://github.com/Azure/azure-cosmos-table-dotnet/issues/14
- BenKoth6 years agoRegular Visitor
I was able to get a solution from the issue/idea I submitted.
let ConvertTimestamp = (ts) => #datetime(1, 1, 1, 0, 0, 0) + #duration(0, 0, 0, ts / 10000000) in ConvertTimestamp(635912639960000000)