Formatting dates in Java

Asked

Viewed 758 times

1

Good afternoon, I have a date attribute of an object that persists as a string, because I need it in the format ddMMyyyy at a certain location and also compare with an earlier date. But at another time I need this same attribute to generate a report in full format "dd of month of year". The fact is that I already tried to do this inside Jasper when I call the attribute but I have not succeeded yet. the closest I came was to use substrings to separate the date but I can’t find a way to make the month that is in numerical format be presented in full in the report. Someone has a suggestion.

  • If you can put the code you’re trying to.

1 answer

3


  • Thanks Douglas, but this way requires that I have a separator in my string. I read the doc and managed to get close parsing the string and passing with the separator. But at the time of putting the two expressions in Jasper gave error syntax.

  • When parsing for String, can’t you remove the two tabs? Thus would be valid for date manipulation with tabs and to show remove without tabs.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.