public class PointOfTime
extends java.lang.Object
implements java.io.Serializable
Date with a more powerful string-arg constructor.| Constructor and Description |
|---|
PointOfTime()
The current time, a.k.a 'now'.
|
PointOfTime(long ms) |
PointOfTime(java.lang.String s)
Accepts point-of-time specifications in any of the following formats:
1999-12-31T23:59:59 (the "T" separates the date from the time-of-day)
1999-12-31T23:59
1999-12-31 (midnight on the specified date)
|
| Modifier and Type | Method and Description |
|---|---|
PointOfTime |
add(double seconds) |
PointOfTime |
add(Duration duration) |
long |
milliseconds() |
Duration |
subtract(PointOfTime other) |
java.lang.String |
toString() |
public PointOfTime()
public PointOfTime(java.lang.String s)
throws java.text.ParseException
1999-12-31T23:59:59 (the "T" separates the date from the time-of-day)1999-12-31T23:591999-12-31 (midnight on the specified date)java.text.ParseExceptionpublic PointOfTime(long ms)
ms - The number of non-leap milliseconds since 1970-01-01 00:00:00 UTCpublic long milliseconds()
public java.lang.String toString()
toString in class java.lang.Objectpublic PointOfTime add(double seconds)
seconds after this PointOfTimepublic PointOfTime add(Duration duration)
duration after this PointOfTimepublic Duration subtract(PointOfTime other)
other to this