public enum VCardDateFormat extends Enum<VCardDateFormat>
Enum Constant and Description |
---|
BASIC
Formats dates using "basic" format.
|
EXTENDED
Formats dates using "extended" format.
|
Modifier and Type | Method and Description |
---|---|
String |
format(TemporalAccessor temporalAccessor)
Formats a date (also accepts
ZoneOffset ). |
static boolean |
hasTime(TemporalAccessor temporalAccessor)
Determines if the given date has a time component
|
static Temporal |
parse(String string)
Parses a date string.
|
static VCardDateFormat |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static VCardDateFormat[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final VCardDateFormat EXTENDED
Formats dates using "extended" format. In this format, dashes separate the date components, and colons separate the time components.
Examples:
LocalDate
)LocalDateTime
)OffsetDateTime
)Instant
)public static final VCardDateFormat BASIC
Formats dates using "basic" format. In this format, nothing separates the date and time components from each other.
Examples:
LocalDate
)LocalDateTime
)OffsetDateTime
)Instant
)public static VCardDateFormat[] values()
for (VCardDateFormat c : VCardDateFormat.values()) System.out.println(c);
public static VCardDateFormat valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic String format(TemporalAccessor temporalAccessor)
ZoneOffset
).temporalAccessor
- the datepublic static Temporal parse(String string)
Parses a date string. String can be in basic or extended formats.
Examples:
LocalDate
LocalDateTime
OffsetDateTime
Instant
string
- the string to parseIllegalArgumentException
- if the date string isn't in one of the
accepted ISO8601 formats or if it contains an invalid value (e.g. "13"
for the month)public static boolean hasTime(TemporalAccessor temporalAccessor)
temporalAccessor
- the dateCopyright © 2012–2023 Michael Angstadt. All rights reserved.