Package com.jidesoft.utils
Class TimeUtils
java.lang.Object
com.jidesoft.utils.TimeUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DatecreateTime(String timeString) Makes it easier to create Date objects from strings without having to remember the symbols required for a SimpleDateFormat.static doublestatic doublestatic booleanstatic booleanisSameHour(Calendar c1, Calendar c2) static booleanisSameInField(int field, Calendar c1, Calendar c2) static booleanisSameMillis(Calendar c1, Calendar c2) static booleanisSameMinute(Calendar c1, Calendar c2) static booleanisSameMonth(Calendar c1, Calendar c2) static booleanisSameSecond(Calendar c1, Calendar c2) static booleanisSameWeek(Calendar c1, Calendar c2) static booleanisSameYear(Calendar c1, Calendar c2) static Calendarstatic longmillisDiff(Calendar c1, Calendar c2) static Calendarstatic doubleminutesDiff(Calendar c1, Calendar c2) static Integerstatic doublesecondsDiff(Calendar c1, Calendar c2) static doublestatic 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
Dateobject 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
-