// Collection of code snippets by Arne Vajhøj 
// (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) 
import java.util.*;
import java.text.*;

public class TimeConvert {
   private static DateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss zzz yyyy");
   public static void main(String[] args) throws Exception {
      Calendar c = new GregorianCalendar(2003, Calendar.MARCH, 2);
      String s = df.format(c.getTime());
      System.out.println(s);
      Date d = df.parse(s);
      Calendar c2 = new GregorianCalendar();
      c2.setTime(d);
      System.out.println(c2.getTime());
   }
}
