org.das2.datum.format.TimeDatumFormatter

Formatter is configured with strings of SimpleDateFormat (yyyy-MM-DD) or % percent format (%Y-%m-%d) specifiers. SimpleDateFormat is discouraged because most other parts of das2 use the shorter form. This does not support formats with seconds but no hours and minutes, like "$Y $j $S"


DAY_OF_YEAR

yyyy-JJJ


DOY_DAYS

yyyy-MM-dd (JJJ)


MICROSECONDS

HH:mm:ss.SSSSSS


NANOSECONDS

HH:mm:ss.SSSSSSSSS


formatterForScale

formatterForScale( int scale, DatumRange context ) → TimeDatumFormatter

returns a TimeDatumFormatter suitable for the specified scale and context. Context may be null to indicate that the formatted string will be interpreted outside of any context.

Parameters

scale - the length we wish to represent, such as TimeUtil.HOUR
context - the context for the formatter, or null if the formatted string will be interpreted outside of any context.

Returns:

the formatter.

search for examples view on GitHub view source