I am using Jaspersoft 6.16. I have a field STARTDATE, retrieving data from a table in the database. The field type in the database is date. Now when I am previewing the report it shows data as (MM/DD/YYYY, TIMESTAMP). But i want it as (DD/MM/YYYY) only. 

Please suggest an easy and step-by-step solution. Thanks

tayyebkhan's picture
Joined: Feb 22 2014 - 7:19am
Last seen: 1 month 3 weeks ago

1 Answer:

There are multiple ways to do that date formatting.

1. Use the "Pattern" field on the "Text Field" tab.  The ... can help with many different formats


2. Create an expression with the formatting built-in using SimpleDateFormat()

new SimpleDateFormat( "dd/MM/yyyy").format($F{MySqlDate})

jgust's picture
Joined: Jun 10 2010 - 6:39am
Last seen: 2 hours 18 min ago