public class HerdDateUtils
extends org.apache.commons.lang3.time.DateUtils
| Constructor and Description |
|---|
HerdDateUtils() |
| Modifier and Type | Method and Description |
|---|---|
static Timestamp |
addDays(Timestamp timestamp,
int amount)
Adds a number of days to a timestamp returning a new object.
|
static Timestamp |
addMinutes(Timestamp timestamp,
int amount)
Adds a number of minutes to a timestamp returning a new object.
|
static Boolean |
containsTimePortion(XMLGregorianCalendar xmlGregorianCalendar)
Determines if a provided
XMLGregorianCalendar calendar object contains a time portion |
static Timestamp |
convertToTimestamp(XMLGregorianCalendar xmlGregorianCalendar)
Converts a provided
XMLGregorianCalendar calendar object to a Timestamp object |
static String |
formatDuration(long duration)
Formats a "total milliseconds" duration.
|
static Calendar |
getCurrentCalendarNoTime()
Returns a calendar for the current day that does not have the time set.
|
static XMLGregorianCalendar |
getXMLGregorianCalendarValue(Date date)
Gets an instance of XMLGregorianCalendar class initialized per the specified java.util.Date value.
|
static XMLGregorianCalendar |
now()
Gets the current date/time as an XMLGregorianCalendar with the default time zone in the default locale.
|
static Timestamp |
resetTimeToMidnight(XMLGregorianCalendar xmlGregorianCalendar)
Removes time portion of the date time object.
|
addDays, addHours, addMilliseconds, addMinutes, addMonths, addSeconds, addWeeks, addYears, ceiling, ceiling, ceiling, getFragmentInDays, getFragmentInDays, getFragmentInHours, getFragmentInHours, getFragmentInMilliseconds, getFragmentInMilliseconds, getFragmentInMinutes, getFragmentInMinutes, getFragmentInSeconds, getFragmentInSeconds, isSameDay, isSameDay, isSameInstant, isSameInstant, isSameLocalTime, iterator, iterator, iterator, parseDate, parseDate, parseDateStrictly, parseDateStrictly, round, round, round, setDays, setHours, setMilliseconds, setMinutes, setMonths, setSeconds, setYears, toCalendar, toCalendar, truncate, truncate, truncate, truncatedCompareTo, truncatedCompareTo, truncatedEquals, truncatedEqualspublic static Calendar getCurrentCalendarNoTime()
public static String formatDuration(long duration)
duration - the duration in milliseconds to format.public static XMLGregorianCalendar now()
public static XMLGregorianCalendar getXMLGregorianCalendarValue(Date date)
date - the java.util.Date value to be converted into XMLGregorianCalendar.public static Timestamp addDays(Timestamp timestamp, int amount)
Timestamp is unchanged.timestamp - the timestamp, not nullamount - the amount to add, may be negativeTimestamp with the amount addedpublic static Timestamp addMinutes(Timestamp timestamp, int amount)
Timestamp is unchanged.timestamp - the timestamp, not nullamount - the amount to add, may be negativeTimestamp with the amount addedpublic static Timestamp resetTimeToMidnight(XMLGregorianCalendar xmlGregorianCalendar)
xmlGregorianCalendar - the xmlGregorianCalendar, not nullTimestamp with reset time portionpublic static Timestamp convertToTimestamp(XMLGregorianCalendar xmlGregorianCalendar)
XMLGregorianCalendar calendar object to a Timestamp objectxmlGregorianCalendar - the specified XMLGregorianCalendar objectTimestamp objectpublic static Boolean containsTimePortion(XMLGregorianCalendar xmlGregorianCalendar)
XMLGregorianCalendar calendar object contains a time portionxmlGregorianCalendar - the specified XMLGregorianCalendar objectCopyright © 2021. All rights reserved.