Jump to content
We've recently updated our Privacy Statement, available here ×

Decreasing hours from a date field


MikeM19

Recommended Posts

Hello guys,

I'm running a report where i'm extracting from my db a java.sql.timestamp field, is there any way to decrease the hour part? i mean if i have a "04/09/15 07:24 PM" how can i convert it to "04/09/15 02:24 PM", i hope someone around can help me with this.

 

Regards!

Link to comment
Share on other sites

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Thank you both for your answers,

Asimkin,

I tried with your expression but there is no change, i use it on the Text field expression, is that ok? any additional thing i must do?

Hozawa,

I'm pretty new with Ireports, i really don't know where to implement your suggestion, can you give more details about it?

Best regards!

Link to comment
Share on other sites

Thanks you both,

What i did to make this work was to use the expression "new Date($F{my_field}.getTime() - 5 * 3600*1000)" on the text field expression propertie and it totally works, thanks to asimkin and hozawa for putting me on the right way on this one.

Best regards!

 

Link to comment
Share on other sites

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...