1 16 17 18 package org.apache.xmlrpc.util; 19 20 import java.text.DateFormat ; 21 import java.text.ParseException ; 22 import java.text.SimpleDateFormat ; 23 import java.util.Date ; 24 25 31 public class DateTool 32 { 33 protected static final String FORMAT = "yyyyMMdd'T'HH:mm:ss"; 34 35 private DateFormat df; 36 37 43 public DateTool() 44 { 45 df = new SimpleDateFormat (FORMAT); 46 } 47 48 52 public synchronized String format(Date d) 53 { 54 return df.format(d); 55 } 56 57 62 public synchronized Date parse(String s) 63 throws ParseException  64 { 65 return df.parse(s); 66 } 67 } 68 | Popular Tags |