01: // Copyright (c) 2003-2007, Jodd Team (jodd.sf.net). All Rights Reserved.
02:
03: package jodd.datetime.formatter;
04:
05: import jodd.datetime.DateTimeStamp;
06: import jodd.datetime.JDateTime;
07:
08: /**
09: * Date time formatter performs conversion both from and to string representation of time.
10: *
11: * @see AbstractFormatter
12: */
13: public interface JdtFormatter {
14:
15: /**
16: * Converts date time to a string using specified format.
17: *
18: * @param jdt JDateTime to read from
19: * @param format format
20: *
21: * @return formatted string with date time information
22: */
23: String convert(JDateTime jdt, String format);
24:
25: /**
26: * Parses string given in specified format and extracts time information.
27: * It returns a new instance of <code>DateTimeStamp</code> or <code>null</code> if error occurs.
28: *
29: * @param value string containing date time values
30: * @param format format
31: *
32: * @return DateTimeStamp instance with populated data
33: */
34: DateTimeStamp parse(String value, String format);
35: }
|