• Post Reply Bookmark Topic Watch Topic
  • New Topic

SimpleDateFormat class throws ArithmeticException: / by zero  RSS feed

 
Kanakam Murali Krishna
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

I am using the SimpleDateFormat class to format the java.util.Date into required formats like yyyyMMddHHmmssS and yyyy_MM_dd. I have started my java applciation in day time and kept the same until next day.

My application uses the logic specified above quite freequently to get the date in required format(s). Suddenly after some time in the night, my applciation started getting exception as below. Throughout the night my system started getting these errors.

Could some one help me what could be the problem with the following code.

new SimpleDateFormat("yyyy_MM_dd").format(new java.util.Date());
new SimpleDateFormat("yyyyMMddHHmmssS").format(new java.util.Date())


java.lang.ArithmeticException: / by zero
java/util/Hashtable.get(Ljava/lang/Object Ljava/lang/Object;+16 (Hashtable.java:316)
java/util/ListResourceBundle.handleGetObject(Ljava/lang/String Ljava/lang/Object;+15 (ListResourceBundle.java:122)
java/util/ResourceBundle.getObject(Ljava/lang/String Ljava/lang/Object;+1 (ResourceBundle.java:371)
java/text/DateFormatSymbols.initializeData(Ljava/util/Locale V+16 (DateFormatSymbols.java:483)
java/text/DateFormatSymbols.<init>(Ljava/util/Locale V+44 (DateFormatSymbols.java:99)
java/text/SimpleDateFormat.<init>(Ljava/lang/String V+5 (SimpleDateFormat.java:264)
com/oe/utils/LogMessage.logln(Ljava/lang/String;I)V+10 (:??)
com/oe/utils/LogMessage.trace(Ljava/lang/String V+1 (:??)
com/oe/appmngr/AMLogMessage.trace(Ljava/lang/String V+1 (:??)
com/oe/appmngr/ReqHandler.run()V+179 (:??)
com/oe/framework/TaskThread.run()V+12 (:??)
java/lang/Thread.run()V+11 (Thread.java:479)

Thanks & Best regards
Murali
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!