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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd aTimespanto this dateintdifference(Date other) booleanlongGet the timestamp of this dateinthashCode()Get a new instance of this Date with the subtracted timespanstatic Datenow()Get a new Date with the current timeGet a new instance of this Date with the added timespanvoidSubtract aTimespanfrom 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:
compareToin interfaceComparable<Date>
-
toString
-
getTimestamp
public long getTimestamp()Get the timestamp of this date- Returns:
- The timestamp in milliseconds
-
add
Add aTimespanto this date- Parameters:
span- Timespan to add
-
subtract
Subtract aTimespanfrom 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
-