Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get date in YYYYMMDD format

 
shama parween
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi ,

In whatever the format we enter the date, it should check if its a valid date and should return in YYYYMMDD format without any spaces,slash aur hyphen.
Please help me with this.
 
Jesper de Jong
Java Cowboy
Saloon Keeper
Pie
Posts: 15435
41
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use class SimpleDateFormat to format your Date object into a string with the desired format. See the API documentation of class SimpleDateFormat to find out how to do it exactly.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic