[ot]Date utilitiy to take date String, add a day, and return sql date?
I need to see if anyone has a utility to take a String date, add 1 day, and return a java.sql.Date -- Thanks Mick Knutson (925) 951-4126 HP Consulting Services Safeway (Blackhawk Fastword Project) J2EE Architect --- MMS safeway.com made the following annotations. -- Warning: All e-mail sent to this address will be received by the Safeway corporate e-mail system, and is subject to archival and review by someone other than the recipient. This e-mail may contain information proprietary to Safeway and is intended only for the use of the intended recipient(s). If the reader of this message is not the intended recipient(s), you are notified that you have received this message in error and that any review, dissemination, distribution or copying of this message is strictly prohibited. If you have received this message in error, please notify the sender immediately. == - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ot]Date utilitiy to take date String, add a day, and return sql date?
Mick Knutson wrote: I need to see if anyone has a utility to take a String date, add 1 day, and return a java.sql.Date I'd probably check out the Calendar class. Dave Newton Technical Lead, MonkeyLips Omnigalgomon Project - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ot]Date utilitiy to take date String, add a day, and return sql date?
Mick, You can refer following code but still you have to convert the type in the last because this method returns string. public static String addDaysToDate( String strDate, String noofDays, String dateFormat ) throws Exception { Calendar calendar = Calendar.getInstance(); String str_dt = ; SimpleDateFormat formatter = new SimpleDateFormat( dateFormat ); Date input_dt = formatter.parse( strDate ); calendar.setTime( input_dt ); calendar.add( Calendar.DATE, Integer.parseInt( noofDays ) ); Date result_dt = calendar.getTime(); str_dt = formatter.format( result_dt ); return str_dt; } Hope it helps Sunil Dave Newton [EMAIL PROTECTED] 10/17/2005 11:37 PM Please respond to Struts Users Mailing List user@struts.apache.org To Struts Users Mailing List user@struts.apache.org cc Subject Re: [ot]Date utilitiy to take date String, add a day, and return sql date? Mick Knutson wrote: I need to see if anyone has a utility to take a String date, add 1 day, and return a java.sql.Date I'd probably check out the Calendar class. Dave Newton Technical Lead, MonkeyLips Omnigalgomon Project - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
Re: [ot]Date utilitiy to take date String, add a day, and return sql date?
[EMAIL PROTECTED] wrote: [...] public static String addDaysToDate( String strDate, String noofDays, String dateFormat ) throws Exception noofDays? What are those? Days 30 minutes offset from everywhere else? ;-) L. - To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]