my dog learned polymorphism*
The moose likes Java in General and the fly likes Problem with the date 2005-07-14 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Problem with the date 2005-07-14" Watch "Problem with the date 2005-07-14" New topic
Author

Problem with the date 2005-07-14

Abigail Moore
Greenhorn

Joined: May 13, 2004
Posts: 12
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

Joined: Aug 31, 2004
Posts: 11343

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 ]

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
Abigail Moore
Greenhorn

Joined: May 13, 2004
Posts: 12
Thank you. That helped a lot!
Ravi Srinivas
Greenhorn

Joined: Sep 04, 2003
Posts: 26
Ahh.. the 14th of July, what a troublesome date!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Problem with the date 2005-07-14
 
Similar Threads
array confusion
resultset is not working properly
operator trouble
making a class visible
can any one explain this