Closed ibrahimsharif closed 6 years ago
Hey Ibrahim,
Dates and times that are returned from the API are represented as strings, since JSON has no DateTime type. In PowerShell, you can convert these to any format by first parsing the string into a DateTime object, then converting it back to a string with your preferred format specifier. Here is an example to get the string into the format that Power BI Is displaying in your screenshot above.
$dateTime = [datetime]::parse("2017-10-16T00:00:00Z")
$dateTime.ToString("g")
10/15/2017 5:00 PM
Here are more details on the possible format specifiers: Standard: https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-date-and-time-format-strings Custom: https://docs.microsoft.com/en-us/dotnet/standard/base-types/custom-date-and-time-format-strings
Let me know if this solves your issue!
Nice Thanks, i did as below and it works jubii [datetime]::parse("2017-10-16T00:00:00Z").Tostring('MM/dd/yy HH:mm:ss')
have a greate day, your are my hero today
Excellent! Glad it worked for you.
Recived Data From Device collection, Data Format are not Formatet correctly
This Lines are from the Powershell Module
this is how the date shold appear
Sorry my Broken Englsih 🔢 :)