Package org.cdlib.mrt.utility
Class DateUtil
java.lang.Object
org.cdlib.mrt.utility.DateUtil
- Author:
- dloy
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Date
get current Datestatic Date
getCurrentDatePlus
(long millSecs) return the Date for current + millisecond updatestatic String
getCurrentDateString
(String pattern) return String form of current date using passed patternstatic String
Get the current IsoDate Stringstatic Date
getDateFromString
(String stringDate, String pattern) Build a Date object using a String with an extraction patternstatic String
getDateString
(Date date, String pattern) Return String formatted form of passed Datestatic long
Get current date a Epoch secondsstatic String
getIsoDate
(Date date) Build an IsoDate from a passed Datestatic Date
getIsoDateFromString
(String stringDate) Build Date from a displayed IsoDate stringstatic Date
getIsoDateFromZString
(String stringDate) Build Date from a displayed IsoDate stringstatic String
getIsoZDate
(Date date) Build an IsoDate from a passed Date
-
Field Details
-
ISOZPATTERN
- See Also:
-
ISOPATTERN
- See Also:
-
-
Constructor Details
-
DateUtil
public DateUtil()
-
-
Method Details
-
getCurrentDate
get current Date- Returns:
- current Date
-
getCurrentDatePlus
return the Date for current + millisecond update- Parameters:
millSecs
- adjust for current date- Returns:
- adjusted time
-
getCurrentDateString
return String form of current date using passed pattern- Parameters:
pattern
- pattern for building returned String- Returns:
- formatted current Date
-
getDateString
Return String formatted form of passed Date- Parameters:
date
- Date to formatpattern
- pattern to use for formatting- Returns:
- formatted passed Date
-
getDateFromString
Build a Date object using a String with an extraction pattern- Parameters:
stringDate
-pattern
-- Returns:
-
getIsoDateFromString
Build Date from a displayed IsoDate string- Parameters:
stringDate
- iso string to convert to Date- Returns:
- converted Date
-
getIsoDateFromZString
Build Date from a displayed IsoDate string- Parameters:
stringDate
- iso string to convert to Date- Returns:
- converted Date
-
getCurrentIsoDate
Get the current IsoDate String- Returns:
- current IsoDate
-
getIsoDate
Build an IsoDate from a passed Date- Parameters:
date
- to conver to displayed IsoDate- Returns:
- displayed IsoDate
-
getIsoZDate
Build an IsoDate from a passed Date- Parameters:
date
- to conver to displayed IsoDate- Returns:
- displayed IsoDate
-
getEpochUTCDate
public static long getEpochUTCDate()Get current date a Epoch seconds- Returns:
- Epoch second for current date
-