• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problem with the date 2005-07-14

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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!
 
Sheriff
Posts: 11343
Mac Safari Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you. That helped a lot!
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ahh.. the 14th of July, what a troublesome date!
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic