From: Kamyar Varzandeh [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 29, 2003 10:59 PM
To: JDJList
Subject: [jdjlist] RE: Using SimpleDateFormat
____________________________________________________Thank you all for your help. I have a follow-up question. From performance perspective, is it better to synchronize the methods (and use an instance variable formatter), or to create the formatter inside each method?
Thanks in advance.
Rich Gibbs <[EMAIL PROTECTED]> wrote:
The SimpleDateFormat, and its underlying methods are not threadsafe.____________________________________________________-----Original Message-----
From: Kamyar Varzandeh [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, January 29, 2003 10:35 AM
To: JDJList
Subject: [jdjlist] Using SimpleDateFormatHi:
Are there any issues with using SimpleDateFormat as a static instance variable and then using it in all the methods as in
public class
DateUtil {public static final String MMDDYYYYFormat = "MM/dd/yyyy";
public static final SimpleDateFormat sdf_MMDDYYYY = new SimpleDateFormat(MMDDYYYYFormat);public static
Date toDate(String dateStr) throws ParseException { return sdf_MMDDYYYY.parse(dateStr);}
We have started getting NumberFormatException when invalid data is passed in. We did not get such exceptions before when we had defined the formatter inside the method. Any ideas?
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now ____________________________________________________ To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm Be respectful! Clean up your posts before replying ____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm
Be respectful! Clean up your posts before replying
____________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now ____________________________________________________ To change your JDJList options, please visit: http://www.sys-con.com/java/list.cfm Be respectful! Clean up your posts before replying ____________________________________________________
To change your JDJList options, please visit:
http://www.sys-con.com/java/list.cfm
Be respectful! Clean up your posts before replying
____________________________________________________
