Problem Parsing Date

Hi

I am using the following method to convert string to date-

SimpleDateFormat formater =new SimpleDateFormat ("yyyy-mm-dd");

java.util.Date parsedDate = formater.parse (new_date_closed);// new_date_closed is the string

java.sql.Date date_closed =new java.sql.Date (parsedDate.getTime ());

System.out.println (date_closed);

Strangely, irrespective of what month i enter, it always sets it to 01. Can't figure out what the problem is..

[603 byte] By [java.newBa] at [2007-11-27 10:38:36]
# 1

m = minute

M = month

jverda at 2007-7-28 18:55:32 > top of Java-index,Java Essentials,Java Programming...
# 2

Ohh!

I did not know that.

Thanx!! :-)

java.newBa at 2007-7-28 18:55:32 > top of Java-index,Java Essentials,Java Programming...
# 3

It's in the docs. You just have to read carefully.

jverda at 2007-7-28 18:55:32 > top of Java-index,Java Essentials,Java Programming...