public class TimeSpan
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int |
DAYS_WEEK
Days in a week.
|
static int |
HOURS_DAY
Hours in a day.
|
static int |
MINUTES_HOUR
Minutes in an hour.
|
static int |
MONTHS_YEAR
Months in a year.
|
static int |
SECONDS_MINUTE
Seconds in a minute.
|
static int |
YEARS_CENTURY
Years in a century.
|
static int |
YEARS_MIL
Years in a mil.
|
static int |
YEARS_SCORE
Years in a score.
|
| Constructor and Description |
|---|
TimeSpan(java.util.Date from,
java.util.Date to)
Construct a time span.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Date |
getFrom() |
long |
getSpan(TimeUnit unit)
Get the time span specified by the unit.
|
java.util.Date |
getTo() |
public static final int YEARS_CENTURY
public static final int HOURS_DAY
public static final int MINUTES_HOUR
public static final int SECONDS_MINUTE
public static final int MONTHS_YEAR
public static final int DAYS_WEEK
public static final int YEARS_MIL
public static final int YEARS_SCORE
public TimeSpan(java.util.Date from,
java.util.Date to)
from - The from date/time.to - The two date/time.public java.util.Date getFrom()
public long getSpan(TimeUnit unit)
unit - The unit desired.public java.util.Date getTo()