• Post Reply Bookmark Topic Watch Topic
  • New Topic

Previous date in Java format ddMMMyyyy  RSS feed

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help me it is very urgent, i am using the below code which is not working in some cases..

Date l_currentDate = new Date();
System.out.println(l_currentDate.getDate()-1);
SimpleDateFormat l_sfCSVDateName = new SimpleDateFormat("yyyyMMM");
String formatedCurrentDate=l_sfCSVDateName.format(l_currentDate); System.out.println("formatedCurrentDate--"+formatedCurrentDate+(l_currentDate.getDate()-1));

Let say current date is 01/05/2007. Then it will return 2005May0.
And i need 2005Apr30.

Please help.
Thanks in advance
Rajesh Swain.
 
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


Please avoid using "it's urgent" here Thank you.
[ May 25, 2007: Message edited by: Satou kurinosuke ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!