org.encog.util.time
Class TimeSpan
- java.lang.Object
-
- org.encog.util.time.TimeSpan
-
public class TimeSpan extends java.lang.ObjectA timespan between two Dates.
-
-
Field Summary
Fields Modifier and Type Field and Description static intDAYS_WEEKDays in a week.static intHOURS_DAYHours in a day.static intMINUTES_HOURMinutes in an hour.static intMONTHS_YEARMonths in a year.static intSECONDS_MINUTESeconds in a minute.static intYEARS_CENTURYYears in a century.static intYEARS_MILYears in a mil.static intYEARS_SCOREYears in a score.
-
Constructor Summary
Constructors Constructor and Description TimeSpan(java.util.Date from, java.util.Date to)Construct a time span.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.util.DategetFrom()longgetSpan(TimeUnit unit)Get the time span specified by the unit.java.util.DategetTo()
-
-
-
Field Detail
-
YEARS_CENTURY
public static final int YEARS_CENTURY
Years in a century.- See Also:
- Constant Field Values
-
HOURS_DAY
public static final int HOURS_DAY
Hours in a day.- See Also:
- Constant Field Values
-
MINUTES_HOUR
public static final int MINUTES_HOUR
Minutes in an hour.- See Also:
- Constant Field Values
-
SECONDS_MINUTE
public static final int SECONDS_MINUTE
Seconds in a minute.- See Also:
- Constant Field Values
-
MONTHS_YEAR
public static final int MONTHS_YEAR
Months in a year.- See Also:
- Constant Field Values
-
DAYS_WEEK
public static final int DAYS_WEEK
Days in a week.- See Also:
- Constant Field Values
-
YEARS_MIL
public static final int YEARS_MIL
Years in a mil.- See Also:
- Constant Field Values
-
YEARS_SCORE
public static final int YEARS_SCORE
Years in a score.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
TimeSpan
public TimeSpan(java.util.Date from, java.util.Date to)Construct a time span.- Parameters:
from- The from date/time.to- The two date/time.
-
-
Method Detail
-
getFrom
public java.util.Date getFrom()
- Returns:
- the from
-
getSpan
public long getSpan(TimeUnit unit)
Get the time span specified by the unit.- Parameters:
unit- The unit desired.- Returns:
- The timespan in the specified unit.
-
getTo
public java.util.Date getTo()
- Returns:
- the to date/time.
-
-
DMelt 3.0 © DataMelt by jWork.ORG