Package restapi.utils.services.date
Interface DateService
- All Known Implementing Classes:
JodaDateService
public interface DateService
Provides the current date.
-
Method Summary
Modifier and TypeMethodDescriptionorg.joda.time.DateTime
dateFromString
(String date) dateToString
(org.joda.time.DateTime dateTime) boolean
isOlderThan
(String dateTime, int min) boolean
isOlderThan
(org.joda.time.DateTime dateTime, int min) org.joda.time.DateTime
now()
-
Method Details
-
now
org.joda.time.DateTime now()- Returns:
- current date at the moment of the call
-
nowToString
String nowToString()- Returns:
- current date at the moment of the call
-
dateToString
- Parameters:
dateTime
- in DateTime format- Returns:
- dateTime in String format
-
dateFromString
- Parameters:
date
- in String format- Returns:
- dateTime in DateTime format
-
isOlderThan
boolean isOlderThan(org.joda.time.DateTime dateTime, int min) - Parameters:
dateTime
- date to compare withmin
- minutes that have to have past- Returns:
- if datetime is older than minutes
-
isOlderThan
- Parameters:
dateTime
- date to compare with in format Stringmin
- minutes that have to have past- Returns:
- if datetime is older than minutes
-