| Package | Description |
|---|---|
| net.time4j |
The main package contains four basic types of ISO-8601, namely
PlainDate, PlainTime, PlainTimestamp
and Moment. |
| net.time4j.engine |
Defines the common generic schemes and interfaces of chronological
systems.
|
| net.time4j.format |
Defines common interfaces for any format support of Time4J.
|
| net.time4j.tz |
General timezone-API.
|
| Modifier and Type | Method and Description |
|---|---|
TZID |
ZonalDateTime.getTimezone() |
TZID |
ZonalClock.getTimezone()
Gets the associated timezone.
|
TZID |
GeneralTimestamp.getTimezone() |
| Modifier and Type | Method and Description |
|---|---|
Moment |
PlainDate.atFirstMoment(TZID tzid)
Creates a new moment which corresponds to this date at earliest valid time
at the begin of associated day in given timezone.
|
PlainTimestamp |
PlainDate.atStartOfDay(TZID tzid)
Creates a new local timestamp with this date at earliest valid time
at the begin of associated day in given timezone.
|
static TemporalFormatter<Moment> |
Moment.formatter(DisplayMode mode,
Locale locale,
TZID tzid)
Creates a new formatter which uses the given display mode and locale
for formatting and parsing moments in given timezone.
|
static <P extends ChronoPattern<P>> |
Moment.formatter(String formatPattern,
P patternType,
Locale locale,
TZID tzid)
Creates a new formatter which uses the given pattern and locale
for formatting and parsing moments in given timezone.
|
ChronoFunction<Moment,V> |
ZonalElement.inTimezone(TZID tzid)
Creates a function which can query a
Moment in the
given timezone. |
Moment |
PlainTimestamp.inTimezone(TZID tzid)
Combines this local timestamp with given timezone to a global
UTC-moment.
|
ChronoOperator<Moment> |
ElementOperator.inTimezone(TZID tzid)
Creates an operator which can adjust a
Moment in the
given timezone. |
static ZonalClock |
SystemClock.inZonalView(TZID tzid)
Creates a local clock in given timezone.
|
ZonalDateTime |
Moment.inZonalView(TZID tzid)
Creates a combination of this moment and given timezone.
|
boolean |
PlainTimestamp.isValid(TZID tzid)
Does this local timestamp exist in given timezone?
|
String |
PrettyTime.printRelative(UnixTime moment,
TZID tzid)
Formats given time point relative to the current time of
PrettyTime.getReferenceClock() as duration in at most second
precision or less. |
String |
PrettyTime.printRelativeOrDate(PlainDate date,
TZID tzid,
CalendarUnit maxRelativeUnit,
TemporalFormatter<PlainDate> formatter)
Formats given date relative to the current date of
PrettyTime.getReferenceClock()
as duration or as absolute date. |
<C extends CalendarVariant<C>> |
Moment.toGeneralTimestamp(CalendarFamily<C> family,
String variant,
TZID tzid,
StartOfDay startOfDay)
Converts this instance to a general timestamp in given timezone.
|
<C extends Calendrical<?,C>> |
Moment.toGeneralTimestamp(Chronology<C> chronology,
TZID tzid,
StartOfDay startOfDay)
Converts this instance to a general timestamp in given timezone.
|
PlainTimestamp |
Moment.toZonalTimestamp(TZID tzid)
Converts this instance to a local timestamp in given timezone.
|
| Constructor and Description |
|---|
ZonalClock(TimeSource<?> timeSource,
TZID tzid)
Constructs a new clock which can yield the current local time in
given timezone.
|
| Modifier and Type | Method and Description |
|---|---|
TZID |
ChronoEntity.getTimezone()
Returns the associated timezone ID for display purposes
if available.
|
TZID |
ChronoDisplay.getTimezone()
Returns the associated timezone ID for display purposes
if available.
|
| Modifier and Type | Method and Description |
|---|---|
abstract int |
StartOfDay.getDeviation(Calendrical<?,?> calendarDay,
TZID tzid)
Deprecated.
The signature will be changed in next major release such
that the type
CalendarDate will be used instead of Calendrical |
| Modifier and Type | Field and Description |
|---|---|
static AttributeKey<TZID> |
Attributes.TIMEZONE_ID
Attribute denoting the timezone identifier for display purposes.
|
| Modifier and Type | Method and Description |
|---|---|
Attributes.Builder |
Attributes.Builder.setTimezone(TZID tzid)
Sets the timezone reference.
|
TemporalFormatter<T> |
TemporalFormatter.withTimezone(TZID tzid)
Creates a copy of this formatter with given timezone id which
shall be used in formatting or parsing.
|
| Modifier and Type | Class and Description |
|---|---|
class |
ZonalOffset
Represents the shift of a local timestamp relative to UTC timezone
usually in full seconds.
|
| Modifier and Type | Method and Description |
|---|---|
abstract TZID |
Timezone.getID()
Gets the associated timezone identifier.
|
| Modifier and Type | Method and Description |
|---|---|
static List<TZID> |
Timezone.getAvailableIDs()
Gets all available timezone IDs.
|
static List<TZID> |
Timezone.getAvailableIDs(String provider)
Gets all available timezone IDs for given
ZoneModelProvider. |
static Set<TZID> |
Timezone.getPreferredIDs(Locale locale,
boolean smart,
String provider)
Gets a provider-specific
Set of preferred timezone IDs
for given ISO-3166-country code. |
| Modifier and Type | Method and Description |
|---|---|
static String |
Timezone.getDisplayName(TZID tzid,
NameStyle style,
Locale locale)
Returns the name of a timezone suitable for presentation to
users in given style and locale.
|
static Timezone |
Timezone.of(String tzid,
TZID fallback)
Tries to load the timezone with the first given identifer else
with given alternative identifier.
|
static Timezone |
Timezone.of(TZID tzid)
Gets the timezone for given identifier.
|
Copyright © 2014–2017. All rights reserved.