cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
AHM
Helper I
Helper I

Time Stamp to Date

Good morning to all!!!

 

A simple one, I´m receiving this time stamp and I need to change it to date:

 

Time Stamp:1551876131000+0100

Human Date:   06/03/2019  9:07:00

 

I all ready have in one column this part:  #datetime(1970,1,1,0,0,0) but I´m not sure how to move forward

 

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

@AHM 

I think Ive got it. try a custom column (PPower Query Editor mode)

a) if you have a format time stamp like 1551876131000+0100

= #datetime(1970,1,1,0,0,0)+#duration(0,0,0,Number.RoundDown(Number.FromText(Text.BeforeDelimiter([Time Stamp],"+"))/1000))

b. if you have a format time stamp like 1583766096983

= #datetime(1970,1,1,0,0,0)+#duration(0,0,0,Number.FromText([Time Stamp])/1000)

 

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

6 REPLIES 6
az38
Community Champion
Community Champion

@AHM 

what is the start point for this time stamp. it doesnt look like Unix  time

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Hi

 

I´m not sure what you mean by Start point, I got this result from an API:  /Date(1551876131000+0100)/ and by using split column i got: 1551876131000+0100

 

In the API document I was able to find this lines that may help to answer the question:

 

JSON

"DateAndTime":"\/Date(1583766096983)\/

 XML

<DateAndTime>2020-03-09T15:01:36.983976Z</DateAndTime>

I this helpfull? 

 

 

az38
Community Champion
Community Champion

@AHM 

I think Ive got it. try a custom column (PPower Query Editor mode)

a) if you have a format time stamp like 1551876131000+0100

= #datetime(1970,1,1,0,0,0)+#duration(0,0,0,Number.RoundDown(Number.FromText(Text.BeforeDelimiter([Time Stamp],"+"))/1000))

b. if you have a format time stamp like 1583766096983

= #datetime(1970,1,1,0,0,0)+#duration(0,0,0,Number.FromText([Time Stamp])/1000)

 

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Worked Perfectly!!!

 

 

 

OK, unless I am mistaken, that is a Unix timestamp in milliseconds. This means that the start point is January 1st, 1970. You could use the quick measures I posted, just have to divide the value by 1000 first.

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

What sort of timestamp is that, unix?

 

Perhaps this: https://community.powerbi.com/t5/Quick-Measures-Gallery/Unix2UTC-and-UTC2Unix/m-p/620012#M292

 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Mastering Power BI 2nd Edition

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors