1 17 package org.alfresco.repo.dictionary; 18 19 import java.text.ParseException ; 20 import java.text.SimpleDateFormat ; 21 import java.util.Date ; 22 23 import org.alfresco.util.CachingDateFormat; 24 25 26 32 public class M2XML 33 { 34 35 42 public static Date deserialiseDate(String date) 43 throws ParseException 44 { 45 Date xmlDate = null; 46 if (date != null) 47 { 48 SimpleDateFormat df = CachingDateFormat.getDateOnlyFormat(); 49 xmlDate = df.parse(date); 50 } 51 return xmlDate; 52 } 53 54 55 61 public static String serialiseDate(Date date) 62 { 63 String xmlDate = null; 64 if (date != null) 65 { 66 SimpleDateFormat df = CachingDateFormat.getDateOnlyFormat(); 67 xmlDate = df.format(date); 68 } 69 return xmlDate; 70 } 71 72 } 73 | Popular Tags |