org.enblom.time
Interface DayDateFormatter


public interface DayDateFormatter

Provides methods for formatting a DayDate 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

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 how these these formatters format dates is summarized here:

ISO:YYYY-MM-DD, YYYYMMDD
EUR:DD.MM.YYYY, DDMMYYYY
US:MM/DD/YYYY, MMDDYYYY

Author:
Andreas Enblom

Method Summary
 String formatCompactDate()
          Formats the date as a compact string, with no delimiters between year, month and date.
 String formatCompactShortDate()
          Formats the date as a compact string, with no delimiters between year, month and date.
 String formatDate()
          Formats the date as a string, with delimiters between year, month and day.
 String formatShortDate()
          Formats the date in a shorter way.
 

Method Detail

formatCompactDate

String formatCompactDate()
Formats the date as a compact string, with no delimiters between year, month and date. The year is written with four digits.
FormatterFormat
ISOYYYYMMDD
EURDDMMYYYY
USMMDDYYYY

Returns:
The date, formatted as a string.

formatCompactShortDate

String formatCompactShortDate()
Formats the date as a compact string, with no delimiters between year, month and date. The year is written with two digits.
FormatterFormat
ISOYYMMDD
EURDDMMYY
USMMDDYY

Returns:
The date, formatted as a string.

formatDate

String formatDate()
Formats the date as a string, with delimiters between year, month and day. The year is written with four digits.
FormatterFormat
ISOYYYY-MM-DD
EURDD.MM.YYYY
USMM/DD/YYYY

Returns:
The date, formatted as a string.

formatShortDate

String formatShortDate()
Formats the date in a shorter way. The year is written with two digits.
FormatterFormat
ISOYY-MM-DD
EURDD.MM.YY
USMM/DD/YY

Returns:
The date, formatted as a string.


Copyright © 2013. All Rights Reserved.