View Javadoc
1   package ejava.projects.esales.xml;
2   
3   import java.util.Calendar;
4   import java.util.Date;
5   import java.util.GregorianCalendar;
6   
7   import javax.xml.bind.DatatypeConverter;
8   
9   public class DateConverter {
10      public static Date parseDate(String s) {
11  	    return DatatypeConverter.parseDate(s).getTime();
12      }
13  	public static String printDate(Date dt) {
14  	    Calendar cal = new GregorianCalendar();
15  		cal.setTime(dt);
16  		return DatatypeConverter.printDate(cal);
17      }
18  }