File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes how to get date in YYYYMMDD format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "how to get date in YYYYMMDD format" Watch "how to get date in YYYYMMDD format" New topic
Author

how to get date in YYYYMMDD format

shama parween
Greenhorn

Joined: Mar 25, 2008
Posts: 3
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

Joined: Aug 16, 2005
Posts: 14074
    
  16

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.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: how to get date in YYYYMMDD format
 
Similar Threads
javascript dates
date/timestamp issue
String to date format
SimpledateFormat format
javascript