Class JavaTimeConverters
- java.lang.Object
-
- com.ibm.icu.impl.JavaTimeConverters
-
@Deprecated public class JavaTimeConverters extends java.lang.Object
Deprecated.This API is ICU internal only.This class provides utility methods for converting between Java 8'sjava.time
classes and theCalendar
and related classes from thecom.ibm.icu.util
package.The class includes methods for converting various temporal types, such as
ZonedDateTime
,OffsetTime
,OffsetDateTime
,LocalTime
,ChronoLocalDate
, andChronoLocalDateTime
, toCalendar
instances.Additionally, it provides methods to convert between
ZoneId
andTimeZone
, andZoneOffset
andTimeZone
.
-
-
Field Summary
Fields Modifier and Type Field Description private static long
MILLIS_PER_DAY
Deprecated.
-
Constructor Summary
Constructors Modifier Constructor Description private
JavaTimeConverters()
Deprecated.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description private static Calendar
millisToCalendar(long epochMillis)
Deprecated.private static Calendar
millisToCalendar(long epochMillis, TimeZone timeZone)
Deprecated.(package private) static Calendar
temporalToCalendar(java.time.chrono.ChronoLocalDate date)
Deprecated.static Calendar
temporalToCalendar(java.time.LocalDateTime dateTime)
Deprecated.This API is ICU internal only.static Calendar
temporalToCalendar(java.time.LocalTime time)
Deprecated.This API is ICU internal only.static Calendar
temporalToCalendar(java.time.OffsetDateTime dateTime)
Deprecated.This API is ICU internal only.static Calendar
temporalToCalendar(java.time.OffsetTime time)
Deprecated.This API is ICU internal only.static Calendar
temporalToCalendar(java.time.temporal.Temporal temp)
Deprecated.This API is ICU internal only.static Calendar
temporalToCalendar(java.time.ZonedDateTime dateTime)
Deprecated.This API is ICU internal only.static TimeZone
zoneIdToTimeZone(java.time.ZoneId zoneId)
Deprecated.This API is ICU internal only.static TimeZone
zoneOffsetToTimeZone(java.time.ZoneOffset zoneOffset)
Deprecated.This API is ICU internal only.
-
-
-
Field Detail
-
MILLIS_PER_DAY
private static final long MILLIS_PER_DAY
Deprecated.- See Also:
- Constant Field Values
-
-
Method Detail
-
temporalToCalendar
@Deprecated public static Calendar temporalToCalendar(java.time.ZonedDateTime dateTime)
Deprecated.This API is ICU internal only.Converts aZonedDateTime
to aCalendar
.This method creates a
Calendar
instance that represents the same date and time as the specifiedZonedDateTime
, taking into account the time zone information associated with theZonedDateTime
.- Parameters:
dateTime
- TheZonedDateTime
to convert.- Returns:
- A
Calendar
instance representing the same date and time as the specifiedZonedDateTime
, with the time zone set accordingly.
-
temporalToCalendar
@Deprecated public static Calendar temporalToCalendar(java.time.OffsetTime time)
Deprecated.This API is ICU internal only.Converts anOffsetTime
to aCalendar
.This method creates a
Calendar
instance that represents the same time of day as the specifiedOffsetTime
, taking into account the offset from UTC associated with theOffsetTime
. The resultingCalendar
will have its date components (year, month, day) set to the current date in the time zone represented by the offset.- Parameters:
time
- TheOffsetTime
to convert.- Returns:
- A
Calendar
instance representing the same time of day as the specifiedOffsetTime
, with the time zone set accordingly and date components set to the current date in that time zone.
-
temporalToCalendar
@Deprecated public static Calendar temporalToCalendar(java.time.OffsetDateTime dateTime)
Deprecated.This API is ICU internal only.Converts anOffsetDateTime
to aCalendar
.This method creates a
Calendar
instance that represents the same date and time as the specifiedOffsetDateTime
, taking into account the offset from UTC associated with theOffsetDateTime
.- Parameters:
dateTime
- TheOffsetDateTime
to convert.- Returns:
- A
Calendar
instance representing the same date and time as the specifiedOffsetDateTime
, with the time zone set accordingly.
-
temporalToCalendar
@Deprecated static Calendar temporalToCalendar(java.time.chrono.ChronoLocalDate date)
Deprecated.Converts aChronoLocalDate
to aCalendar
.This method creates a
Calendar
instance that represents the same date as the specifiedChronoLocalDate
. The resultingCalendar
will be in the default time zone of the JVM and will have its time components (hour, minute, second, millisecond) set to zero.- Parameters:
date
- TheChronoLocalDate
to convert.- Returns:
- A
Calendar
instance representing the same date as the specifiedChronoLocalDate
, with time components set to zero.
-
temporalToCalendar
@Deprecated public static Calendar temporalToCalendar(java.time.LocalTime time)
Deprecated.This API is ICU internal only.Converts aLocalTime
to aCalendar
.This method creates a
Calendar
instance that represents the same time of day as the specifiedLocalTime
. The resultingCalendar
will be in the default time zone of the JVM and will have its date components (year, month, day) set to the current date in the default time zone.- Parameters:
time
- TheLocalTime
to convert.- Returns:
- A
Calendar
instance representing the same time of day as the specifiedLocalTime
, with date components set to the current date in the default time zone.
-
temporalToCalendar
@Deprecated public static Calendar temporalToCalendar(java.time.LocalDateTime dateTime)
Deprecated.This API is ICU internal only.Converts aChronoLocalDateTime
to aCalendar
.This method creates a
Calendar
instance that represents the same date and time as the specifiedChronoLocalDateTime
. The resultingCalendar
will be in the default time zone of the JVM.- Parameters:
dateTime
- TheChronoLocalDateTime
to convert.- Returns:
- A
Calendar
instance representing the same date and time as the specifiedChronoLocalDateTime
.
-
temporalToCalendar
@Deprecated public static Calendar temporalToCalendar(java.time.temporal.Temporal temp)
Deprecated.This API is ICU internal only.Converts aTemporal
to aCalendar
.- Parameters:
temp
- TheTemporal
to convert.- Returns:
- A
Calendar
instance representing the same date and time as the specifiedTemporal
.
-
zoneIdToTimeZone
@Deprecated public static TimeZone zoneIdToTimeZone(java.time.ZoneId zoneId)
Deprecated.This API is ICU internal only.Converts aZoneId
to aTimeZone
.This method creates a
TimeZone
from the specifiedZoneId
. The resultingTimeZone
will represent the time zone rules associated with the givenZoneId
.- Parameters:
zoneId
- The zone ID to convert.- Returns:
- A
TimeZone
representing the time zone rules associated with the givenZoneId
.
-
zoneOffsetToTimeZone
@Deprecated public static TimeZone zoneOffsetToTimeZone(java.time.ZoneOffset zoneOffset)
Deprecated.This API is ICU internal only.Converts aZoneOffset
to aTimeZone
.This method creates a
TimeZone
that has a fixed offset from UTC, represented by the givenZoneOffset
.- Parameters:
zoneOffset
- The zone offset to convert.- Returns:
- A
TimeZone
that has a fixed offset from UTC, represented by the givenZoneOffset
.
-
millisToCalendar
private static Calendar millisToCalendar(long epochMillis)
Deprecated.
-
-