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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
AlbertMaes
Regular Visitor

Java Long Date does not convert to time in query editor

Hi there,

 

new to the forum and new to data modelling...

 

I am connecting to a PostGres Database of our ticketing system (ManageEngine ServiceDesk) where timestamps are stored in what i assume to be a java long date format.

 

The field CREATEDTIME (when a ticket was created) has a value e.g. 1530272032346 which equates to Friday, 29 June 2018 11:33:52 o'clock UTC according to the following website http://www.fileformat.info/tip/java/date2millis.htm

 

When I try to convert the number using the data type selector in the query editor, it seems that the system cannot interpret this number as a date and returns errors. 

 

Only if the value is 0 (e.g. in a RESPONDEDTIME field on a ticket where no response was logged yet) it returns 30/12/1899 00:00:00 +01:00

 

Tried all sorts of settings with regional settings, locale settings etc and have not managed to convert.

 

Can anybody give me a hint as to what i need to do?

 

Kind regards

Albert

1 ACCEPTED SOLUTION
v-lili6-msft
Community Support
Community Support

hi,@AlbertMaes

   You can add a calculate column when you modeling like this

Date = DATEVALUE("1970-1-1") + (Table1[Column1]/(60*60*24*1000))

Result:

4.PNG

 

Best Regards,

Lin

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

View solution in original post

3 REPLIES 3
v-lili6-msft
Community Support
Community Support

hi,@AlbertMaes

   You can add a calculate column when you modeling like this

Date = DATEVALUE("1970-1-1") + (Table1[Column1]/(60*60*24*1000))

Result:

4.PNG

 

Best Regards,

Lin

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

Thank you Lin!  Works a treat!!

AlbertMaes
Regular Visitor

I did some more digging here and it seems that indeed my database churns out Java Date Stamps (Day 0 = 01/01/1970), PowerBI seems to expect SQL Date Stamps (Day 0 = 12/12/1899)

 

How do I tell PowerBI to use a different date stamp?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.