Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
reematalal
New Member

Convert JSON date /Date(1686031729000+0000)/ format in Power Query

Dear All, 

 

Need your kind support in this issue after connecting power bi to API Json format date and time shown as below

/Date(1686031729000+0000)/

how to convert it to normal date? 

 

Thanks in advance. 

1 REPLY 1
ibarrau
Super User
Super User

Hi. As far as I have read this is the format:

  1. “XXXXXX” part is the number of milliseconds since 1 January 1970
  2. “+XXXX” part indicates the time zone, so when you see “+0000”, it means the server time zone is UTC.

If you can just extract that Date to a column, you can transform it with PowerQuery. 

let
    Source = "Date(1686031729000+0000)",
    #"Converted to Table" = #table({"JsonDate"}, {{Source}}),
    start_date = #date(1970,1,1),
    #"Added Seconds" = Table.AddColumn(#"Converted to Table", "Secs", each Number.FromText(Text.BeforeDelimiter(Text.AfterDelimiter([JsonDate], "("), "+"))/1000),
    #"Added NewDate" = Table.AddColumn(#"Added Seconds", "NewDate", each start_date + #duration(0,0,0,[Secs]))
in
    #"Added NewDate"

The code has a hardcoded Date example, but you can use as source the Json response formatted as table. Then a variable that has the starting date point.

The following two steps adding columns are simple. One is converting miliseconds to seconds (divide in 1000) and then add to start_date the seconds to get the date. Result:

 

ibarrau_0-1696338772711.png

I hope that helps,


If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Happy to help!

LaDataWeb Blog

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.