cancel
Showing results for
Did you mean:
Regular Visitor

## Converting UNIX time to Date in PowerBI for Desktop

Hi, i am having issues converting the time in Unix time (60*60*24) to date time.

but i couldnt get it to work. i have the values like the attached in first picture. Please help me convert this number to datetime.

1 ACCEPTED SOLUTION

Accepted Solutions
Moderator

## Re: Converting UNIX time to Date in PowerBI for Desktop

@Bokbob

You can add a custom column

`#datetime(1970, 1, 1, 0, 0, 0) + #duration(0, 0, 0, [UnixTime]/1000)`

7 REPLIES 7
Moderator

## Re: Converting UNIX time to Date in PowerBI for Desktop

@Bokbob

You can add a custom column

`#datetime(1970, 1, 1, 0, 0, 0) + #duration(0, 0, 0, [UnixTime]/1000)`

Highlighted
Regular Visitor

## Re: Converting UNIX time to Date in PowerBI for Desktop

Hey!

And how can i apply this formula but with a specified Time Zone?

Thank you!

Frequent Visitor

## Re: Converting UNIX time to Date in PowerBI for Desktop

hi

I have the same problem my time zone is gmt -6?

Frequent Visitor

## Re: Converting UNIX time to Date in PowerBI for Desktop

hi

I have the same problem my time zone is gmt -6?

Super User

## Re: Converting UNIX time to Date in PowerBI for Desktop

Adjust the formula with -6 as hours in the #duration part:

`#datetime(1970, 1, 1, 0, 0, 0) + #duration(0, -6, 0, [UnixTime]/1000)`

Specializing in Power Query Formula Language (M)
New Member

## Re: Converting UNIX time to Date in PowerBI for Desktop

Hi i make this video to explain

https://youtu.be/3N27eS2oJmA

New Member

## Re: Converting UNIX time to Date in PowerBI for Desktop

Thanks for the post, i got it to work for my data.  Only one point was that the unit time I had was unix time in s not ms, so I didn't need the /1000.  I think unix time is quite common in both formats.