de.unkrig.commons.util.time
Class PointOfTime
java.lang.Object
de.unkrig.commons.util.time.PointOfTime
- All Implemented Interfaces:
- java.io.Serializable
public class PointOfTime
- extends java.lang.Object
- implements java.io.Serializable
Extends Date with a more powerful string-arg constructor.
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
PointOfTime
public PointOfTime()
- The current time, a.k.a 'now'.
PointOfTime
public PointOfTime(java.lang.String s)
throws java.text.ParseException
- Throws:
java.text.ParseException
PointOfTime
public PointOfTime(long ms)
- Parameters:
ms - The number of non-leap milliseconds since 1970-01-01 00:00:00 UTC
milliseconds
public long milliseconds()
- Returns:
- The number of non-leap milliseconds since 1970-01-01 00:00:00 UTC
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object
add
public PointOfTime add(double seconds)
- Returns:
- The given number of
seconds after this PointOfTime
add
public PointOfTime add(Duration duration)
- Returns:
- The given
duration after this PointOfTime
subtract
public Duration subtract(PointOfTime other)
- Returns:
- The length of the interval from
other to this