• Post Reply Bookmark Topic Watch Topic
  • New Topic

regarding dateformat  RSS feed

 
indu iyengar
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,
am getting exception while formatting date from "dd-mmm-yyyy" to "yyyy-mm-dd":


which results in

 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You try to parse (String to Date) "09-Sep-2010" using "yyyy-mm-dd". That's not going to work. You want to parse with one DateFormat, then format (Date to String) with another DateFormat. Remember, Date objects only have a format for debugging purposes.
 
indu iyengar
Ranch Hand
Posts: 115
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thank you Rob ... I got it..
 
James Sabre
Ranch Hand
Posts: 781
Java Netbeans IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
indu iyengar wrote:thank you Rob ... I got it..


and that should be
since 'mm' denotes minutes.
 
Rob Spoor
Sheriff
Posts: 21135
87
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Uhm, yeah. Definitely. I overlooked that one
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!