Back to project page cirrus.
The source code is released under:
Apache License
If you think the Android project cirrus listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.inktomi.cirrus; /* w ww . ja v a 2s.c om*/ import org.simpleframework.xml.transform.Transform; import java.text.SimpleDateFormat; import java.util.Date; /** * Created by mruno on 8/6/13. */ public class DateTransform implements Transform<Date> { private static final SimpleDateFormat DATE_FORMAT = new SimpleDateFormat("yyyy-MM-dd'T'kk:mm:ss"); public DateTransform() {} public Date read(String value) throws Exception { // If we have NA, default to being valid now. if( value.equals("NA") ){ return new Date(); } return DATE_FORMAT.parse(value); } public String write(Date value) throws Exception { return DATE_FORMAT.format(value); } }