public final class DateAsText extends Object implements Text
Text.NoNulls
Constructor and Description |
---|
DateAsText()
Formats current time using the ISO format.
|
DateAsText(Date date)
Formats the date with ISO format using the system zone.
|
DateAsText(Date date,
String format)
Formats the date with to format using the default locale and the system
zone.
|
DateAsText(Date date,
String format,
Locale locale)
Formats the date using the format and locale using the system default
zone.
|
DateAsText(long milliseconds)
Formats the milliseconds using the ISO format.
|
DateAsText(long milliseconds,
String format)
Formats the milliseconds using the format and the default locale.
|
DateAsText(long milliseconds,
String format,
Locale locale)
Formats the milliseconds as date using the format and the locale.
|
DateAsText(TemporalAccessor date)
Formats date using ISO date time format.
|
DateAsText(TemporalAccessor date,
DateTimeFormatter formatter)
Formats the date using the provided formatter.
|
DateAsText(TemporalAccessor date,
String format)
Formats date using provided date time format string using default locale.
|
DateAsText(TemporalAccessor date,
String format,
Locale locale)
Formats the date using the provided format string using the provided
locale.
|
Modifier and Type | Method and Description |
---|---|
String |
asString()
Convert it to the string.
|
int |
compareTo(Text text) |
public DateAsText()
public DateAsText(long milliseconds)
milliseconds
- Milliseconds to format.public DateAsText(long milliseconds, String format)
milliseconds
- Milliseconds to format.format
- The format to use.public DateAsText(long milliseconds, String format, Locale locale)
milliseconds
- Milliseconds to format as date.format
- The format to use.locale
- The locale to use for the format.public DateAsText(Date date)
date
- The date to format.public DateAsText(Date date, String format)
date
- The date to format.format
- The format to use.public DateAsText(Date date, String format, Locale locale)
date
- The date to format.format
- The format to use.locale
- The locale to use.public DateAsText(TemporalAccessor date)
date
- The date to format.public DateAsText(TemporalAccessor date, String format)
date
- The date to format.format
- The format to use.public DateAsText(TemporalAccessor date, String format, Locale locale)
date
- The date to format.format
- The format string to use.locale
- The locale to use.public DateAsText(TemporalAccessor date, DateTimeFormatter formatter)
date
- The date to format.formatter
- The formatter to use.Copyright © 2017 Cactoos. All rights reserved.