Problems with SimpleDateFormat

Pavel Roskin pavel_roskin at geocities.com
Tue May 11 09:47:00 PDT 1999


Hello!

Following program prints

Date = Fri Sep 04 16:47:38 GMT+03:00 1998

in JDK and

Date = September 16, 1970 4:47:38 PM PDT

in Kaffe when the locale variables are unset.
Both the output formats and the actual values are different.
The later difference breaks jCVS.

import java.text.SimpleDateFormat;
import java.util.Date;
import java.text.ParseException;

public class test
{
        public static void main (String argv[])
        {
                SimpleDateFormat format =
                        new SimpleDateFormat ("EEE MMM dd HH:mm:ss yyyy");
                try
                {
                        Date date = 
				format.parse("Fri Sep  4 16:47:38 1998");
                        System.out.println ("Date = " + date);
                }
                catch (ParseException e)
                {
                        System.out.println ("Parse error");
                }
        }
}

Pavel Roskin



More information about the kaffe mailing list