Class TimeFormat
java.lang.Object
com.tccc.kos.commons.util.format.time.TimeFormat
Describes a time format for both Java and JavaScript. This includes a hint
about whether the format is a 12- or 24-hour format, which allows editors to
generate the correct options for the format.
Time formatting characters are:
H = hour-of-day (0-23) h = clock-hour-of-am-pm (1-12) m = minute-of-hour a = am-pm-of-day
- Since:
- 1.0
- Version:
- 2023-02-24
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionTimeFormat(String id, String format, boolean ampm) Creates a new time format with the specified properties. -
Method Summary
-
Constructor Details
-
TimeFormat
Creates a new time format with the specified properties.- Parameters:
id- the ID of the formatformat- format stringampm- true for 12-hour clock formats
-
-
Method Details
-
getId
Returns the ID of the format. This is used to identify and select the format. This should not be a display value. A localization key should be used to convert this to a display string. -
getFormat
Returns the format string for this time format. -
getAmpm
public boolean getAmpm()Returns true for 12-hour clock, false for 24-hour clock.
-