Jump to content
Changes to the Jaspersoft community edition download ×

Rounding when calculating time


chris_51

Recommended Posts

I am trying to calculate the difference between two timestamps in hours.

The results I am getting always round to the nearest hour for sme reason.

The expression I am using is

($F{alt_end_date}. getTime()-$F{alt_start_date}.getTime())/(1000*60*60) + " hours"

alt_start_date & alt_end_date are java.sql.Timestamp

If I remove the calculation to convert the result from ms to hours it gives me the correct result in MS

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...