K
Karl Vernet
Hi all,
I use SimpleDateFormat in many classes, but I can't make it work with
a very simple format :
--------------------------------------
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Date;
public class ParseDate {
public static void main(String[] args)
{
System.out.println( System.getProperty("java.version") );
SimpleDateFormat dateFormat = new SimpleDateFormat( "dd MMM yyyy" );
ParsePosition pos = new ParsePosition( 0 );
Date theDate = dateFormat.parse( "01 Jan 2003", pos );
System.out.println( theDate.toString() );
}
}
--------------------------------------
it gives a java version of 1.4.2_05 and theDate is null !!!!!!!
Any help would be very appreciated.
Thanke in advance
I use SimpleDateFormat in many classes, but I can't make it work with
a very simple format :
--------------------------------------
import java.text.ParsePosition;
import java.text.SimpleDateFormat;
import java.util.Date;
public class ParseDate {
public static void main(String[] args)
{
System.out.println( System.getProperty("java.version") );
SimpleDateFormat dateFormat = new SimpleDateFormat( "dd MMM yyyy" );
ParsePosition pos = new ParsePosition( 0 );
Date theDate = dateFormat.parse( "01 Jan 2003", pos );
System.out.println( theDate.toString() );
}
}
--------------------------------------
it gives a java version of 1.4.2_05 and theDate is null !!!!!!!
Any help would be very appreciated.
Thanke in advance