|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface TimeFormatter
Provides methods for formatting a Time
object as a human-readable
string.
The following notation will be used:
YYYY : | The year written with four digits, e.g. 1066, 1969, 2011 | YY : | The year written with two digits, e.g. 66, 69, 11 | MM : | The month written with two digits, e.g. 02 for February and 10 for October | DD : | The day of the month written with two digits, e.g. 02, 15, 31 | hh : | The hour of the time written with two digits. A 24-hour scale is used, so this will be in the range 00-23. | mm : | The minute of the time written with two digits; in the range 00-59. | ss : | The second of the time written with two digits; in the range 00-59. | nnn : | The millisecond of the time written with three digits; in the range 000-999. |
There are three standard formatters: ISO, EUR and US, provided by
Time.iso()
, Time.eur()
and Time.us()
, respectively.
The ISO formatter formats timestamps according to the ISO-8601 standard, the
EUR formatter formats timestamps according to some de-facto European
standard, and the US formatter formats timestamps according to US standards.
The main difference between these formatters is how dates are formatted:
ISO: | YYYY-MM-DD , YYYYMMDD |
EUR: | DD.MM.YYYY , DDMMYYYY |
US: | MM/DD/YYYY , MMDDYYYY |
Method Summary | |
---|---|
String |
formatCompactDate()
Formats the date of the time as a compact string, with no delimiters between year, month and date. |
String |
formatCompactLongTime()
Formats the time of day of this time as a compact string, with no delimiters between the different parts of this time. |
String |
formatCompactShortDate()
Formats the date of the time as a compact string, with no delimiters between year, month and date. |
String |
formatCompactShortDateAndLongTime()
Formats the the time as a full string. |
String |
formatCompactShortDateAndShortTime()
Formats the the time as a full string. |
String |
formatCompactShortDateAndTime()
Formats the the time as a full string. |
String |
formatCompactShortTime()
Formats the time of day of this time as a compact string, with no delimiters between the different parts of this time. |
String |
formatCompactTime()
Formats the time of day of this time as a compact string, with no delimiters between the different parts of this time. |
String |
formatDate()
Formats the date of this time as a string, with delimiters between year, month and day. |
String |
formatDateAndLongTime()
Formats the the time as a full string. |
String |
formatDateAndShortTime()
Formats the the time as a full string. |
String |
formatDateAndTime()
Formats the the time as a full string. |
String |
formatLongTime()
Formats the time of day of the time as a string, with delimiters between the different parts of this time. |
String |
formatShortDate()
Formats the date of this time as a string, with delimiters between year, month and day. |
String |
formatShortDateAndLongTime()
Formats the the time as a full string. |
String |
formatShortDateAndShortTime()
Formats the the time as a full string. |
String |
formatShortDateAndTime()
Formats the the time as a full string. |
String |
formatShortTime()
Formats the time of day of the time as a string, with delimiters between the different parts of this time. |
String |
formatTime()
Formats the time of day of the time as a string, with delimiters between the different parts of this time. |
Method Detail |
---|
String formatDate()
Formatter | Format |
---|---|
ISO | YYYY-MM-DD |
EUR | DD.MM.YYYY |
US | MM/DD/YYYY |
String formatShortDate()
Formatter | Format |
---|---|
ISO | YY-MM-DD |
EUR | DD.MM.YY |
US | MM/DD/YY |
String formatCompactDate()
Formatter | Format |
---|---|
ISO | YYYYMMDD |
EUR | DDMMYYYY |
US | MMDDYYYY |
String formatCompactShortDate()
Formatter | Format |
---|---|
ISO | YYMMDD |
EUR | DDMMYY |
US | MMDDYY |
String formatTime()
Formatter | Format |
---|---|
ISO | hh:mm:ss |
EUR | hh:mm:ss |
US | hh:mm:ss |
String formatLongTime()
Formatter | Format |
---|---|
ISO | hh:mm:ss.nnn |
EUR | hh:mm:ss.nnn |
US | hh:mm:ss.nnn |
String formatShortTime()
Formatter | Format |
---|---|
ISO | hh:mm |
EUR | hh:mm |
US | hh:mm |
String formatCompactTime()
Formatter | Format |
---|---|
ISO | hhmmss |
EUR | hhmmss |
US | hhmmss |
String formatCompactLongTime()
Formatter | Format |
---|---|
ISO | hhmmssnnn |
EUR | hhmmssnnn |
US | hhmmssnnn |
String formatCompactShortTime()
Formatter | Format |
---|---|
ISO | hhmm |
EUR | hhmm |
US | hhmm |
String formatDateAndTime()
Formatter | Format |
---|---|
ISO | YYYY-MM-DD hh:mm:ss |
EUR | DD.MM.YYYY hh:mm:ss |
US | MM/DD/YYYY hh:mm:ss |
String formatDateAndLongTime()
Formatter | Format |
---|---|
ISO | YYYY-MM-DD hh:mm:ss.nnn |
EUR | DD.MM.YYYY hh:mm:ss.nnn |
US | MM/DD/YYYY hh:mm:ss.nnn |
String formatDateAndShortTime()
YYYY-MM-DD hh:mm
DD.MM.YYYY hh:mm
MM/DD/YYYY hh:mm
String formatShortDateAndTime()
Formatter | Format |
---|---|
ISO | YY-MM-DD hh:mm:ss |
EUR | DD.MM.YY hh:mm:ss |
US | MM/DD/YY hh:mm:ss |
String formatShortDateAndLongTime()
Formatter | Format |
---|---|
ISO | YY-MM-DD hh:mm:ss.nnn |
EUR | DD.MM.YY hh:mm:ss.nnn |
US | MM/DD/YY hh:mm:ss.nnn |
String formatShortDateAndShortTime()
Formatter | Format |
---|---|
ISO | YY-MM-DD hh:mm |
EUR | DD.MM.YY hh:mm |
US | MM/DD/YY hh:mm |
String formatCompactShortDateAndTime()
Formatter | Format |
---|---|
ISO | YYMMDD hh:mm:ss |
EUR | DDMMYY hh:mm:ss |
US | MMDDYY hh:mm:ss |
String formatCompactShortDateAndLongTime()
Formatter | Format |
---|---|
ISO | YYMMDD hh:mm:ss.nnn |
EUR | DDMMYY hh:mm:ss.nnn |
US | MMDDYY hh:mm:ss.nnn |
String formatCompactShortDateAndShortTime()
Formatter | Format |
---|---|
ISO | YYMMDD hh:mm |
EUR | DDMMYY hh:mm |
US | MMDDYY hh:mm |
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |