Jump to content
Changes to the Jaspersoft community edition download ×

Java.util.Date() - format output


foster

Recommended Posts

  • Replies 5
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

On ireport u can set a defined patter for your field ;right click on the field and check the property .leave the class expression as java.lang.Date and edit the pattern.

Code:
http://www.google.it/firefox?client=firefox-a&rls=com.ubuntu:en-US:official
Link to comment
Share on other sites

foster,

 

In general it's better to use a localized date format. Something like this:
DateFormat.getDateInstance(DateFormat.SHORT, $P{REPORT_LOCALE}).format( new java.util.Date() )

 

But if you prefer to hardcode the format in your case, you can do it like this:
new SimpleDateFormat("dd.MM.yyyy").format( $P{MyDateParam} )

 

See more details here:
http://java.sun.com/j2se/1.5.0/docs/api/java/text/SimpleDateFormat.html

 

Regards,
Matt

Link to comment
Share on other sites

  • 5 years later...

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