how to convert string date to date format in jasper report


Hi Friend I've use Jasper Ireport 5.2.0, i want to generate student mark sheet with student date of birth.

Data type of a date of birth in Table is varchar, so I've convert string date to original date format but result is wrong.

For example date of birth is 08-08-1994(dd-MM-yyyy) but i got after convertion like this 08-04-1996(dd-MM-yyyy). my convertion code is,

new java.text.SimpleDateFormat("dd-MM-yyyy").format(new java.text.SimpleDateFormat("dd-MM-yyyy").parse($F{birthDate})).

where i got mistake, any one can help me asap..... my process is pending.

Thanks to advance

udumanajmeer's picture
Joined: Jun 4 2013 - 9:00pm
Last seen: 6 years 2 months ago

5 Answers:


Hey  I hvae tested in my side your code is working fine. You can check with $F{birthDate} field , are you getting correct date form DB or not.

sambitgudu's picture
Joined: Sep 26 2012 - 3:25am
Last seen: 5 years 8 months ago
(new SimpleDateFormat("dd/MM/yy").format($F{birthDate})) try this.......... i think it will work for you...
chaitanya chauhan's picture
Joined: Jul 30 2013 - 11:57pm
Last seen: 8 years 2 weeks ago

I have a Similar Problem. For a jasper report, I am passing the Report Date as Parameter String in dd/MM/yyyy format. But I would like to convert this string to MMM dd, yyyy format during the runtime. The (new SimpleDateformat ("MMM dd, yyyy).format($P{REPORT_DATE}) is not working, I get runtime error. Please help



vickey24's picture
Joined: May 2 2014 - 4:11am
Last seen: 5 years 9 months ago

(new SimpleDateFormat("MMM dd, YYYY").format($P{REPORT_DATE}))


This will work. SimpleDateFormat is case sensitive.

virenptl40's picture
Joined: Jul 3 2014 - 6:43am
Last seen: 6 years 3 weeks ago

new java.text.SimpleDateFormat("mm/dd/yyyy").format(new java.text.SimpleDateFormat("yyyy-mm-dd").parse($F{occurrenceDate})) try this inside expression  editor

harshalsonar777's picture
Joined: Jun 16 2020 - 4:00am
Last seen: 7 months 1 week ago