udumanajmeer Posted November 11, 2013 Share Posted November 11, 2013 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 Link to comment Share on other sites More sharing options...
sambitgudu Posted November 11, 2013 Share Posted November 11, 2013 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. Link to comment Share on other sites More sharing options...
chaitanya chauhan Posted January 2, 2014 Share Posted January 2, 2014 (new SimpleDateFormat("dd/MM/yy").format($F{birthDate}))[/code] try this.......... i think it will work for you... Link to comment Share on other sites More sharing options...
vickey24 Posted July 9, 2014 Share Posted July 9, 2014 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 Link to comment Share on other sites More sharing options...
virenptl40 Posted March 28, 2015 Share Posted March 28, 2015 (new SimpleDateFormat("MMM dd, YYYY").format($P{REPORT_DATE})) This will work. SimpleDateFormat is case sensitive. Link to comment Share on other sites More sharing options...
harshalsonar777 Posted March 19, 2021 Share Posted March 19, 2021 new java.text.SimpleDateFormat("mm/dd/yyyy").format(new java.text.SimpleDateFormat("yyyy-mm-dd").parse($F{occurrenceDate})) try this inside expression editor Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now