Package org.openbravo.test.util
Class DateUtils
- java.lang.Object
-
- org.openbravo.test.util.DateUtils
-
public class DateUtils extends Object
Testing utilities to work with dates
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static Date
daysAfter(int days)
Gets the date of n days after todaystatic Date
daysAgo(int days)
Gets the date of n days ago starting from todaystatic Instant
hoursAgo(int hoursAgo)
Gets the Instant of n hours ago starting from nowstatic Date
today()
Gets today's datestatic Date
tomorrow()
Gets tomorrow's datestatic Date
yesterday()
Gets yesterday's date
-
-
-
Method Detail
-
yesterday
public static Date yesterday()
Gets yesterday's date- Returns:
- a
Date
with the day of yesterday
-
tomorrow
public static Date tomorrow()
Gets tomorrow's date- Returns:
- a
Date
with the date of tomorrow
-
daysAgo
public static Date daysAgo(int days)
Gets the date of n days ago starting from today- Parameters:
days
- The number of days to be subtracted to the current date- Returns:
- a
Date
with the date of n days ago, where n is the provided value.
-
daysAfter
public static Date daysAfter(int days)
Gets the date of n days after today- Parameters:
days
- The number of days to be added to the current date- Returns:
- a
Date
with the date of n days after, where n is the provided value.
-
-