Follow the links below to browse sample Javadoc for MJ classes and tools, including the MJ Runtime Library.

 

Package: com.arsi.mj.text.datefmt  previous next contents

The datefmt package contains the formatting implementations related to dates. In general, these utilities should always be used via static reference if one is available.

Date values are constrained as follows:

When a time is coerced into a date, the number of hours in the time is treated as the number of days since the minimum valid date; minutes and seconds are discarded. When a number is coerced into a date, the integer portion is treated as the number of days since the minimum valid date less one; fractional content is discarded.

Chart shows date format names, a description, presentation, and the raw pattern used.
Format Reference Description Default Presentation of April 28th, 2012 Format Pattern
Date0 Presents input in a date format 50428 yMMdd
Date1 Presents input in a date format 150428 yyMMdd
Date2 Presents input in a date format; spaces are preserved for both parsing and formatting 28 APR 15 dd MMM yy
Date3 Presents input in a date format based on the year and Julian day 5118 yDDD
Date4 Presents input in a date format based on the year and Julian day 15118 yyD
Date5 Presents input in a date format 280415 ddMMyy
Date6 Presents input in a date format 04/28/15 MM/dd/yy
Date7 Presents input in a date format APRIL 28, 2105 MMMMMMMMM d, yyyy
Date8 Presents input in a date format 042815 MMddyy
Date9 Presents input in a date format 28/04/15 dd/MM/yy
Date11 Presents input in a date format 20150428 yyyyMMdd
Date12 Presents input in a date format 28 APR 2015 dd MMM yyyy
Date14 Presents input in a date format based on the year and Julian day 2015118 yyyyDDD
Date15 Presents input in a date format based 28042015 ddMMyyyy
Date16 Presents input in a date format 04/28/2015 MM/dd/yyyy
Date18 Presents input in a date format 04282015 MMddyyyy
Date19 Presents input in a date format 28/04/2015 dd/MM/yyyy
Date20 Presents input in a date format 2015-04-28 yyyy-MM-dd
DateC Presents input in a date format APRIL MMMMMMMMM
DateD Presents input in a date format 28 d
DateJ Presents input in a date format 118 D
DateM Presents input in a date format 4 M
DateY Presents input in a date format 15 yy
DateZ Presents input in a date format 2015 yyyy
Classes and Interfaces
CustomDateFormatBase Custom date format base class for all single-digit year date formats; needed since FastDateFormat (like JDK7) returns two digits for "Y".
Date0Format Custom date format class for single-digit year date format DATE0$ (implements the pattern YMMDD, which is also used for the @DAT format A); needed since FastDateFormat (like JDK7) returns two digits for "Y".
Date11Format Custom date format class for four-digit year date format DATE11$ (implements the pattern YYYYMMDD, which is also used for the @DAT format L) Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
Date12Format Custom date format class for four-digit year date format DATE12$ (implements the pattern DD MMM YYYY, which is also used for the @DAT format M) Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
Date14Format Custom date format class for four-digit year date format DATE14$ (implements the pattern YYYYDDD, which is also used for the @DAT format O) Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
Date15Format Custom date format class for four-digit year date format DATE15$ (implements the pattern DDMMYYYY, which is also used for the @DAT format P) Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
Date16Format Custom date format class for four-digit year date format DATE16$ (implements the pattern MM/DD/YYYY, which is also used for the @DAT format Q) Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
Date18Format Custom date format class for four-digit year date format DATE18$ (implements the pattern MMDDYYYY, which is also used for the @DAT format S) Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
Date19Format Custom date format class for four-digit year date format DATE19$ (implements the pattern DD/MM/YYYY, which is also used for the @DAT format T) Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
Date1Format Custom date format class for single-digit year date format DATE1$ (implements the pattern YYMMDD, which is also used for the @DAT format B) Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
Date20Format Custom date format class for four-digit year date format DATE20$ (implements the pattern YYYY-MM-DD, which is also used for the @DAT format U) Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
Date2Format Custom date format class for double-digit year date format DATE2$ (implements the pattern DD MMM YY, which is also used for the @DAT format C) Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
Date3Format Custom date format class for single-digit year date format DATE3$ (implements the pattern YDDD, which is also used for the @DAT format D); needed since FastDateFormat (like JDK7) returns two digits for "Y".
Date4Format Custom date format class for double-digit year date format DATE4$ (implements the pattern YYDDD, which is also used for the @DAT format E) Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
Date5Format Custom date format class for double-digit year date format DATE5$ (implements the pattern DDMMYY, which is also used for the @DAT format F) Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
Date6Format Custom date format class for double-digit year date format DATE6$ (implements the pattern MM/DD/YY, which is also used for the @DAT format G) Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
Date7Format Custom date format class for four-digit year date format DATE7$ (implements the pattern MONTH DD, YYYY, which is also used for the @DAT format H) Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
Date8Format Custom date format class for double-digit year date format DATE8$ (implements the pattern MMDDYY, which is also used for the @DAT format I) Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
Date9Format Custom date format class for double-digit year date format DATE9$ (implements the pattern DD/MM/YY, which is also used for the @DAT format J) Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
DateCFormat Custom date format class for the @CAL date format D(C) (implements the pattern MONTH).
DateDFormat Custom date format class for the @CAL date format D(D) (implements the pattern D).
DateFormatCustomizer Enumeration instances are used to perform custom processing and validation during date formatting.
DateJFormat Custom date format class for the @CAL date format D(J) (implements the pattern DDD).
DateMFormat Custom date format class for the @CAL date format D(M) (implements the pattern M).
DateNFormat Custom date format class for the @CAL date format D(N) (implements the pattern DAY NUMBER) (numerical day of week, with Sunday being 1).
DateWFormat Custom date format class for the @CAL date format D(W) (implements the pattern DAY NAME).
DateYFormat Custom date format class for the @CAL double-digit year date format D(Y) (implements the pattern YY).
DateZFormat Custom date format class for the @CAL four-digit year date format D(Z) (implements the pattern YYYY).
DecimalAcceptingDateFormatBase Custom date format base class for all date formats that accept values between zero and one exclusive (the values are treated as unformatted literals).

Class: CustomDateFormatBase   next package

Custom date format base class for all single-digit year date formats; needed since FastDateFormat (like JDK7) returns two digits for "Y".

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public abstract class com.arsi.mj.text.datefmt.CustomDateFormatBase
  extends com.arsi.mj.text.CustomDateTimeFormat
Constructors
Ctor for initializing an instance of this class; uses default customization of the date format.
Parameters:
aPattern - the pattern to use for formatting
protected CustomDateFormatBase(java.lang.String aPattern)
Ctor for initializing an instance of this class.
Parameters:
aPattern - the pattern to use for formatting
aFormat - the format for content display
aFormatCustomizer - the customizer used for handling any non-standard or externalized formatting
protected CustomDateFormatBase(java.lang.String aPattern, com.arsi.mj.text.datefmt.DateFormatCustomizer aFormatCustomizer)
Ctor for initializing an instance of this class; uses default customization of the date format.
Parameters:
aPattern - the pattern to use for formatting
aFormat - the format for content display
protected CustomDateFormatBase(java.lang.String aPattern, com.arsi.mj.text.FormatOption aFormat)
Ctor for initializing an instance of this class.
Parameters:
aPattern - the pattern to use for formatting
aFormat - the format for content display
aFormatCustomizer - the customizer used for handling any non-standard or externalized formatting
protected CustomDateFormatBase(java.lang.String aPattern, com.arsi.mj.text.FormatOption aFormat, com.arsi.mj.text.datefmt.DateFormatCustomizer aFormatCustomizer)
Methods
Implementation that replaces basic formatting with results from custom formatting.
See Also:
org.apache.commons.lang3.time.FastDateFormat#applyRules(java.util.Calendar, java.lang.StringBuffer)
protected java.lang.StringBuffer applyRules(java.util.Calendar aCalendar, java.lang.StringBuffer aBuffer)
Customizes the base implementation to handle the Mapper number-to-date coercion logic.
See Also:
org.apache.commons.lang3.time.FastDateFormat#format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition)
public java.lang.StringBuffer format(java.lang.Object anObject, java.lang.StringBuffer aTargetBuffer, java.text.FieldPosition aPosition)

Class: Date0Format   previous next package

Custom date format class for single-digit year date format DATE0$ (implements the pattern YMMDD, which is also used for the @DAT format A); needed since FastDateFormat (like JDK7) returns two digits for "Y".

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date0Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date0Format()

Class: Date11Format   previous next package

Custom date format class for four-digit year date format DATE11$ (implements the pattern YYYYMMDD, which is also used for the @DAT format L)

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date11Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date11Format()

Class: Date12Format   previous next package

Custom date format class for four-digit year date format DATE12$ (implements the pattern DD MMM YYYY, which is also used for the @DAT format M)

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date12Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date12Format()

Class: Date14Format   previous next package

Custom date format class for four-digit year date format DATE14$ (implements the pattern YYYYDDD, which is also used for the @DAT format O)

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date14Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date14Format()

Class: Date15Format   previous next package

Custom date format class for four-digit year date format DATE15$ (implements the pattern DDMMYYYY, which is also used for the @DAT format P)

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date15Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date15Format()

Class: Date16Format   previous next package

Custom date format class for four-digit year date format DATE16$ (implements the pattern MM/DD/YYYY, which is also used for the @DAT format Q)

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date16Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date16Format()

Class: Date18Format   previous next package

Custom date format class for four-digit year date format DATE18$ (implements the pattern MMDDYYYY, which is also used for the @DAT format S)

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date18Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date18Format()

Class: Date19Format   previous next package

Custom date format class for four-digit year date format DATE19$ (implements the pattern DD/MM/YYYY, which is also used for the @DAT format T)

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date19Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date19Format()

Class: Date1Format   previous next package

Custom date format class for single-digit year date format DATE1$ (implements the pattern YYMMDD, which is also used for the @DAT format B)

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date1Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date1Format()

Class: Date20Format   previous next package

Custom date format class for four-digit year date format DATE20$ (implements the pattern YYYY-MM-DD, which is also used for the @DAT format U)

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date20Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date20Format()

Class: Date2Format   previous next package

Custom date format class for double-digit year date format DATE2$ (implements the pattern DD MMM YY, which is also used for the @DAT format C)

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date2Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date2Format()

Class: Date3Format   previous next package

Custom date format class for single-digit year date format DATE3$ (implements the pattern YDDD, which is also used for the @DAT format D); needed since FastDateFormat (like JDK7) returns two digits for "Y".

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date3Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date3Format()

Class: Date4Format   previous next package

Custom date format class for double-digit year date format DATE4$ (implements the pattern YYDDD, which is also used for the @DAT format E)

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date4Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date4Format()

Class: Date5Format   previous next package

Custom date format class for double-digit year date format DATE5$ (implements the pattern DDMMYY, which is also used for the @DAT format F)

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date5Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date5Format()

Class: Date6Format   previous next package

Custom date format class for double-digit year date format DATE6$ (implements the pattern MM/DD/YY, which is also used for the @DAT format G)

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date6Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date6Format()

Class: Date7Format   previous next package

Custom date format class for four-digit year date format DATE7$ (implements the pattern MONTH DD, YYYY, which is also used for the @DAT format H)

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date7Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date7Format()

Class: Date8Format   previous next package

Custom date format class for double-digit year date format DATE8$ (implements the pattern MMDDYY, which is also used for the @DAT format I)

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date8Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date8Format()

Class: Date9Format   previous next package

Custom date format class for double-digit year date format DATE9$ (implements the pattern DD/MM/YY, which is also used for the @DAT format J)

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.Date9Format
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public Date9Format()

Class: DateCFormat   previous next package

Custom date format class for the @CAL date format D(C) (implements the pattern MONTH).

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.DateCFormat
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public DateCFormat()

Class: DateDFormat   previous next package

Custom date format class for the @CAL date format D(D) (implements the pattern D).

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.DateDFormat
  extends com.arsi.mj.text.datefmt.DecimalAcceptingDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public DateDFormat()

Class: DateFormatCustomizer   previous next package

Enumeration instances are used to perform custom processing and validation during date formatting.
public class com.arsi.mj.text.datefmt.DateFormatCustomizer
  extends java.lang.Enum
Fields
Performs no formatting; used when the existing formats handle all available cases.
public static final com.arsi.mj.text.datefmt.DateFormatCustomizer FORMAT_DEFAULT
Provides conversion from Java to Mapper weekday numbering; conversion only takes place if date is a valid Mapper date.
public static final com.arsi.mj.text.datefmt.DateFormatCustomizer FORMAT_WEEKDAY
Handles year-specific formatting and validation for single-digit year formats. Formats using this customization should not include any year data in their base formats.
public static final com.arsi.mj.text.datefmt.DateFormatCustomizer FORMAT_Y
Handles year-specific formatting and validation for double-digit year formats.
public static final com.arsi.mj.text.datefmt.DateFormatCustomizer FORMAT_YY
Handles year-specific formatting and validation for four-digit year formats.
public static final com.arsi.mj.text.datefmt.DateFormatCustomizer FORMAT_YYYY
Methods
Customizes the default formatting transform to support custom Mapper formats.
Parameters:
aContentSource - date source information.
aFormattedDate - date formatted using the base format.
Returns:
the customized result.
public abstract java.lang.String transform(java.util.Calendar aContentSource, java.lang.String aFormattedDate)
public static com.arsi.mj.text.datefmt.DateFormatCustomizer valueOf(java.lang.String name)
public static com.arsi.mj.text.datefmt.DateFormatCustomizer values()

Class: DateJFormat   previous next package

Custom date format class for the @CAL date format D(J) (implements the pattern DDD).

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.DateJFormat
  extends com.arsi.mj.text.datefmt.DecimalAcceptingDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public DateJFormat()

Class: DateMFormat   previous next package

Custom date format class for the @CAL date format D(M) (implements the pattern M).

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.DateMFormat
  extends com.arsi.mj.text.datefmt.DecimalAcceptingDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public DateMFormat()

Class: DateNFormat   previous next package

Custom date format class for the @CAL date format D(N) (implements the pattern DAY NUMBER) (numerical day of week, with Sunday being 1).

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.DateNFormat
  extends com.arsi.mj.text.datefmt.DecimalAcceptingDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public DateNFormat()

Class: DateWFormat   previous next package

Custom date format class for the @CAL date format D(W) (implements the pattern DAY NAME).

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.DateWFormat
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public DateWFormat()

Class: DateYFormat   previous next package

Custom date format class for the @CAL double-digit year date format D(Y) (implements the pattern YY).

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.DateYFormat
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public DateYFormat()

Class: DateZFormat   previous next package

Custom date format class for the @CAL four-digit year date format D(Z) (implements the pattern YYYY).

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public class com.arsi.mj.text.datefmt.DateZFormat
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Public ctor for initializing an instance of this class.
public DateZFormat()

Class: DecimalAcceptingDateFormatBase   previous package

Custom date format base class for all date formats that accept values between zero and one exclusive (the values are treated as unformatted literals).

Treat this class as "thread-safe" (actually it relies on the thread safety of FastDateFormat).
public abstract class com.arsi.mj.text.datefmt.DecimalAcceptingDateFormatBase
  extends com.arsi.mj.text.datefmt.CustomDateFormatBase
Constructors
Ctor for initializing an instance of this class; uses default customization of the date format.
Parameters:
aPattern - the pattern to use for formatting
protected DecimalAcceptingDateFormatBase(java.lang.String aPattern)
Ctor for initializing an instance of this class.
Parameters:
aPattern - the pattern to use for formatting
aFormatCustomizer - the customizer used for handling any non-standard or externalized formatting
protected DecimalAcceptingDateFormatBase(java.lang.String aPattern, com.arsi.mj.text.datefmt.DateFormatCustomizer aFormatCustomizer)
Methods
Customizes the base implementation to handle the Mapper number-to-date coercion logic for formats that accept fractional positive values.
See Also:
org.apache.commons.lang3.time.FastDateFormat#format(java.lang.Object, java.lang.StringBuffer, java.text.FieldPosition)
public java.lang.StringBuffer format(java.lang.Object anObject, java.lang.StringBuffer aTargetBuffer, java.text.FieldPosition aPosition)