How to make a split second and timezone in the template optional?
"yyyy-MM-dd'T'HH:mm:ss.SSS Z" I use in
SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSz"); I'm trying to do all this for the class.
public class DateAdapter extends XmlAdapter<String, Date> { private final SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS Z"); @Override public String marshal(Date v) throws Exception { synchronized (dateFormat) { return dateFormat.format(v); } } @Override public Date unmarshal(String v) throws Exception { synchronized (dateFormat) { return dateFormat.parse(v); } } }
(...)?where...is the optional regular expression section - cpp questionsSimpleDateFormat? And what will happen if the timeline comes without fractions of seconds? An exception? - gil9red 1:01 pm