Package com.jidesoft.utils
Class TimeUtils
java.lang.Object
com.jidesoft.utils.TimeUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Date
createTime
(String timeString) Makes it easier to create Date objects from strings without having to remember the symbols required for a SimpleDateFormat.static double
static double
static boolean
static boolean
isSameHour
(Calendar c1, Calendar c2) static boolean
isSameInField
(int field, Calendar c1, Calendar c2) static boolean
isSameMillis
(Calendar c1, Calendar c2) static boolean
isSameMinute
(Calendar c1, Calendar c2) static boolean
isSameMonth
(Calendar c1, Calendar c2) static boolean
isSameSecond
(Calendar c1, Calendar c2) static boolean
isSameWeek
(Calendar c1, Calendar c2) static boolean
isSameYear
(Calendar c1, Calendar c2) static Calendar
static long
millisDiff
(Calendar c1, Calendar c2) static Calendar
static double
minutesDiff
(Calendar c1, Calendar c2) static Integer
static double
secondsDiff
(Calendar c1, Calendar c2) static double
static double
-
Constructor Details
-
TimeUtils
public TimeUtils()
-
-
Method Details
-
createTime
Makes it easier to create Date objects from strings without having to remember the symbols required for a SimpleDateFormat.The format used is "dd-MMM-yyyy HH:mm:ss", so an acceptable date is for example 05-Dec-1999 20:04:15
- Parameters:
timeString
- a time string in the format "dd-MMM-yyyy HH:mm:ss" (eg. 05-Dec-1999 20:04:15)- Returns:
- a
Date
object corresponding to the date/time in the supplied string. - Throws:
ParseException
-
mostSignificantDifference
- Parameters:
c1
-c2
-- Returns:
- the int field from the Calendar class at which the dates differ. This will be one of YEAR, MONTH, WEEK_OF_YEAR, DAY_OF_YEAR, HOUR_OF_DAY, MINUTE, SECOND, MILLISECOND, or null if there are no differences.
-
isSameYear
-
isSameMonth
-
isSameWeek
-
isSameDay
-
isSameHour
-
isSameMinute
-
isSameSecond
-
isSameMillis
-
isSameInField
-
yearsDiff
-
weeksDiff
-
daysDiff
-
hoursDiff
-
minutesDiff
-
secondsDiff
-
millisDiff
-
min
-
max
-