Jump to content
We've recently updated our Privacy Statement, available here ×

Textfield with calculated date


toxy

Recommended Posts

Hello!

Again I need some help... (iReport 4.1.1)

I have a textfield in my report with two dates, today and a date some days later. My problem is the sytax for adding days to the date:

"Geburtstagsliste vom " + new SimpleDateFormat( "dd.MM.yyyy" ).format( new Date() ) + " bis " + *today+2days*) ???[/code]

I've found some postings about "calendar.add(...)" but my tries are all...

thanks a lot!

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

sanbez
Wrote:

Try adding "manually" two days in milliseconds.
For example: new SimpleDateFormat( "dd.MM.yyyy" ).format(new Date().getTime()+86400000*2)

But IMHO is not good solution. But it must work.



Post Edited by sanbez at 10/13/2011 17:00

/tools/fckeditor/editor/images/smiley/msn/teeth_smile.gif it works! of course not sooo elegant, but short and clear!

Thank you very much!

Link to comment
Share on other sites

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