- Since:
- 6
- Author:
- Mark Rotteveel
-
Method Summary
Modifier and TypeMethodDescriptionstatic DateConverts a local date to a date using calendarc.static LocalDatetoLocalDate(Date val, @Nullable Calendar c) Converts a date to a local date using calendarc.static LocalDateTimetoLocalDateTime(Timestamp val, @Nullable Calendar c) Converts a timestamp to a local date time using calendarc.static LocalTimetoLocalTime(Time val, @Nullable Calendar c) Converts a time to a local time using calendarc.static TimeConverts a local time to a time using calendarc.static TimestamptoTimestamp(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
cis 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
cis 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
cis 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
cis 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
cis 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
cis 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
-