Package org.serviceconnector.util
Class DateTimeUtility
java.lang.Object
org.serviceconnector.util.DateTimeUtility
The Class DateTimeUtility. Provides basic date time operations.
-
Method Summary
Modifier and TypeMethodDescriptionstatic DateGets the current datestatic DateGets the current time.static longGets the current time (ms).static StringGets the current time zone millis.static StringgetDateTimeAsString(Date date) Gets the date time as string.static DategetIncrementTimeMillis(Date date, long inc) Gets the increment time in millis.static booleanChecks if is same day.static DateparseDateString(String dateString) Parses the date string.static DateparseDateStringUTC(String dateString) Parses the date string to UTC.
-
Method Details
-
getCurrentTimeZoneMillis
Gets the current time zone millis.- Returns:
- the current time zone millis
-
getCurrentTime
Gets the current time.- Returns:
- the current time
-
getCurrentDate
Gets the current date- Returns:
- the current date
-
getCurrentTimeMillis
public static long getCurrentTimeMillis()Gets the current time (ms).- Returns:
- the current time (ms)
-
getDateTimeAsString
Gets the date time as string.- Parameters:
date- the date- Returns:
- the date and time as string
-
getIncrementTimeMillis
Gets the increment time in millis.- Parameters:
date- the dateinc- the inc- Returns:
- the increment time in millis
-
parseDateString
Parses the date string.- Parameters:
dateString- the date string- Returns:
- the date
- Throws:
ParseException- the parse exception
-
parseDateStringUTC
Parses the date string to UTC.- Parameters:
dateString- the date string- Returns:
- the date
- Throws:
ParseException- the parse exception
-
isSameDay
Checks if is same day.- Parameters:
date- the date- Returns:
- true, if is same day
-