Package org.bgerp.util
Class TimeConvert
java.lang.Object
org.bgerp.util.TimeConvert
Date ant time converting utils.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final DateConverts beginning of a day to date.static final DateConverts the first day of a month to date.static DurationtoDuration(LocalTime value) Converts a local time to duration between 0 and the timestatic final InstanttoInstant(LocalDateTime value) Converts date and time to instant.static final LocalDatetoLocalDate(Date value) Converts date to local date.static LocalTimetoLocalTime(Duration duration) Converts a duration to time after adding the duration to 0static final TimestamptoTimestamp(Date value) Converts date to SQL timestamp.static final YearMonthtoYearMonth(Date value) Converts date to month of year.
-
Constructor Details
-
TimeConvert
public TimeConvert()
-
-
Method Details
-
toYearMonth
Converts date to month of year.- Parameters:
value-- Returns:
nullor month, containingvalue.
-
toDate
Converts the first day of a month to date.- Parameters:
value- the month.- Returns:
nullor date of the first day of the monthvalue.
-
toDate
Converts beginning of a day to date.- Parameters:
value- the day.- Returns:
nullor date of the beginning of the dayvalue.
-
toLocalDate
Converts date to local date.- Parameters:
value-- Returns:
nullor converted value.
-
toTimestamp
Converts date to SQL timestamp.- Parameters:
value-- Returns:
nullor converted value.
-
toInstant
Converts date and time to instant.- Parameters:
value-- Returns:
nullor converted value.
-
toDuration
Converts a local time to duration between 0 and the time- Parameters:
value-- Returns:
-
toLocalTime
Converts a duration to time after adding the duration to 0- Parameters:
duration-- Returns:
-