wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes SimpleDateFormat Problem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "SimpleDateFormat Problem" Watch "SimpleDateFormat Problem" New topic

SimpleDateFormat Problem

Kassi Hill

Joined: Sep 29, 2003
Posts: 24
I am trying to format a string using the SimpleDateFormat method and it is not working. I was hoping that someone more experienced could point out my problem. Thank you.

private String assignDate;

public void setAssignDate(String aDate){
SimpleDateFormat fdate = new SimpleDateFormat("MM-DD-YY");
assignDate = fdate.format(aDate);
}catch (Exception e){}
Jim Yingst

Joined: Jan 30, 2000
Posts: 18671
Consult the SimpleDateFormat API, and see what is the difference between m and M, d and D, y and Y, etc.

"I'm not back." - Bill Harding, Twister
I agree. Here's the link: http://aspose.com/file-tools
subject: SimpleDateFormat Problem
Similar Threads
conversion of string into java.util.Date
java.sql.SQLException: ORA-01858: a non-numeric character was found where a numeric
Between Syntax
primary key associated with wrong data
Difficult trying to convert a String to a Date