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

How do I format correctly a time Field in Jasper Reports ?


csrchvz15
Go to solution Solved by csrchvz15,

Recommended Posts

Hello good afternoon I want to ask if someone would be able to help me out with a problem that I have with giving the right format to a field in jasper reports.
What I want to do is to display a number of hours of a field type time, this is what I have made by far:

<textFieldExpression><![CDATA[new java.text.SimpleDateFormat("hh:mm").format($F{TIEMPO_SOPORTE})]]></textFieldExpression>

The result I get with that sentence are pretty much what I want to see, but you see right now my problem is that I get some of information incorrectly because if the time is less than an hour I get 12: preceding the minutes.

Example:

If the field on the database says that the time is 0:15 minutes, the reports says that the information is 12:15.
But the data says that the time is more than an hour it displays it correctly.

So I wonder if someone could help me out with this problem?

Link to comment
Share on other sites

  • 2 weeks later...
  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

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