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 convert date to dd-mm-yyyy pattern Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » Java in General
Reply Bookmark "convert date to dd-mm-yyyy pattern" Watch "convert date to dd-mm-yyyy pattern" New topic
Author

convert date to dd-mm-yyyy pattern

sameera liyanage
Ranch Hand

Joined: Nov 25, 2008
Posts: 643
i have a Date object.i need to convert it to the dd-mm-yyyy pattern.
can anyone send me the code?
Kumar Agaram
Greenhorn

Joined: May 27, 2009
Posts: 1
private SimpleDateFormat sdf = new SimpleDateFormat("MM-dd-yyyy");
String dateStr = sdf.format(dateObject);
Campbell Ritchie
Sheriff

Joined: Oct 13, 2005
Posts: 32651
    
    4
Welcome to JavaRanch Kumar Agaram, and thank you for the answer.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel
 
subject: convert date to dd-mm-yyyy pattern
 
Similar Threads
How to convert String to Date
conversion of date
[log4j] DailyRollingFileAppender
Number of days from today
JSTL <fmt:parseDate>