- Since:
- 6
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptionstatic Date
Converts a local date to a date using calendarc
.static LocalDate
toLocalDate
(Date val, @Nullable Calendar c) Converts a date to a local date using calendarc
.static LocalDateTime
toLocalDateTime
(Timestamp val, @Nullable Calendar c) Converts a timestamp to a local date time using calendarc
.static LocalTime
toLocalTime
(Time val, @Nullable Calendar c) Converts a time to a local time using calendarc
.static Time
Converts a local time to a time using calendarc
.static Timestamp
toTimestamp
(LocalDateTime val, @Nullable Calendar c) Converts a local date time to a timestamp using calendarc
.
-
Method Details
-
toLocalDateTime
Converts a timestamp to a local date time using calendarc
.If
c
is null, or the time zone is equal to the JVM default time zone, conversion is performed usingTimestamp.toLocalDateTime()
instead ofc
.- Parameters:
val
- timestampc
- calendar- Returns:
- local date time
-
toTimestamp
Converts a local date time to a timestamp using calendarc
.If
c
is null, or the time zone is equal to the JVM default time zone, conversion is performed usingTimestamp.valueOf(LocalDateTime)
instead ofc
.- Parameters:
val
- local date timec
- calendar- Returns:
- timestamp
-
toLocalTime
Converts a time to a local time using calendarc
.If
c
is null, or the time zone is equal to the JVM default time zone, conversion is performed usingTime.toLocalTime()
instead ofc
.- Parameters:
val
- timec
- calendar- Returns:
- local time
-
toTime
Converts a local time to a time using calendarc
.If
c
is null, or the time zone is equal to the JVM default time zone, conversion is performed usingTime.valueOf(LocalTime)
instead ofc
.- Parameters:
val
- local timec
- calendar- Returns:
- time
-
toLocalDate
Converts a date to a local date using calendarc
.If
c
is null, or the time zone is equal to the JVM default time zone, conversion is performed usingDate.toLocalDate()
instead ofc
.- Parameters:
val
- timec
- calendar- Returns:
- local time
-
toDate
Converts a local date to a date using calendarc
.If
c
is null, or the time zone is equal to the JVM default time zone, conversion is performed usingDate.valueOf(LocalDate)
instead ofc
.- Parameters:
val
- local timec
- calendar- Returns:
- time
-