• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem with the date 2005-07-14

 
Abigail Moore
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi I am having a problem with a date being passed as 2005-07-14 from a String Array of selected dates.

Here is my code:

private String getMaximum(String[] array)
{
int maximum = 0;

if (logger.isInfoEnabled())
{
logger.info("WizardReportForm getMaximum()");
}
if (array != null)
{


for (int index = 0; index < array.length; index++)
{

int value = Integer.parseInt(array[index]);
System.out.println(value);
System.out.println(maximum);
if (value > maximum)
{
maximum = value;

}

}

String str = Integer.toString(maximum);

return str;
}
return null;

}


How do I take that date and remove the dashes- but keep the orginal in the array list, and pass the date without the dashes on to the db.

Help Lost again!
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not really following your process, but if all you need to do is create a new String that's like the old String except that it has the dashes removed (keeping the old String intact), try this...

[ August 02, 2005: Message edited by: marc weber ]
 
Abigail Moore
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you. That helped a lot!
 
Ravi Srinivas
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ahh.. the 14th of July, what a troublesome date!
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic