Package ch.njol.skript.util
Class Date
java.lang.Object
ch.njol.skript.util.Date
- All Implemented Interfaces:
YggdrasilSerializable
,Comparable<Date>
-
Nested Class Summary
Nested classes/interfaces inherited from interface ch.njol.yggdrasil.YggdrasilSerializable
YggdrasilSerializable.YggdrasilExtendedSerializable, YggdrasilSerializable.YggdrasilRobustEnum, YggdrasilSerializable.YggdrasilRobustSerializable
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Add aTimespan
to this dateint
difference(Date other)
boolean
long
Get the timestamp of this dateint
hashCode()
Get a new instance of this Date with the subtracted timespanstatic Date
now()
Get a new Date with the current timeGet a new instance of this Date with the added timespanvoid
Subtract aTimespan
from this datetoString()
-
Constructor Details
-
Date
public Date() -
Date
public Date(long timestamp) -
Date
-
-
Method Details
-
now
Get a new Date with the current time- Returns:
- New date with the current time
-
difference
-
compareTo
- Specified by:
compareTo
in interfaceComparable<Date>
-
toString
-
getTimestamp
public long getTimestamp()Get the timestamp of this date- Returns:
- The timestamp in milliseconds
-
add
Add aTimespan
to this date- Parameters:
span
- Timespan to add
-
subtract
Subtract aTimespan
from this date- Parameters:
span
- Timespan to subtract
-
plus
Get a new instance of this Date with the added timespan- Parameters:
span
- Timespan to add to this Date- Returns:
- New Date with the added timespan
-
minus
Get a new instance of this Date with the subtracted timespan- Parameters:
span
- Timespan to subtract from this Date- Returns:
- New Date with the subtracted timespan
-
hashCode
public int hashCode() -
equals
-