## 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"

## TimeDatumFormatter( String formatString )

Creates a new instance of TimeDatumFormatter

## DEFAULT

yyyy-MM-dd'T'HH:mm:ss.SSS'Z

## DAYS

yyyy-MM-dd

## DAY_OF_YEAR

yyyy-JJJ

## DOY_DAYS

yyyy-MM-dd (JJJ)

## YEARS

yyyy

## MONTHS

yyyy-MM

## HOURS

yyyy-MM-dd HH:'00'

## MINUTES

HH:mm

## SECONDS

HH:mm:ss

## MILLISECONDS

HH:mm:ss.SSS

## MICROSECONDS

HH:mm:ss.SSSSSS

## NANOSECONDS

HH:mm:ss.SSSSSSSSS

## format

format( Datum datum ) → String

### Parameters

datum - a Datum

### Returns:

java.lang.String
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## formatterForScale

formatterForScale( int scale, DatumRange context ) → org.das2.datum.format.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 on old javadoc] [view source]

## formatterForScale

formatterForScale( int scale, DatumRange context, boolean useDOY ) → org.das2.datum.format.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.
useDOY - if true then use day-of-year rather than separate month and day.

### Returns:

the formatter.
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## guessFormatter

guessFormatter( org.das2.datum.DatumVector ticks, DatumRange context ) → org.das2.datum.format.TimeDatumFormatter

guess formatted based on the two ticks given

### Parameters

ticks - values to represent
context - null or the external context where the data is interpreted.

### Returns:

the formatter

### See Also:

DateTimeDatumFormatter#axisFormat
[search for examples] [view on GitHub] [view on old javadoc] [view source]

## toString

toString( ) → String

### Returns:

java.lang.String
[search for examples] [view on GitHub] [view on old javadoc] [view source]