Class Date
java.lang.Object
java.util.Date
ch.njol.skript.util.Date
- All Implemented Interfaces:
YggdrasilSerializable, Serializable, Cloneable, Comparable<Date>
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from interface YggdrasilSerializable
YggdrasilSerializable.YggdrasilExtendedSerializable, YggdrasilSerializable.YggdrasilRobustEnum, YggdrasilSerializable.YggdrasilRobustSerializable -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd aTimespanto this datedifference(Date other) Returns the difference between this date and another date as aTimespan.booleanstatic DatefromJavaDate(Date date) longDeprecated, for removal: This API element is subject to removal in a future version.inthashCode()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()Methods inherited from class Date
after, before, clone, compareTo, from, getDate, getDay, getHours, getMinutes, getMonth, getSeconds, getTime, getTimezoneOffset, getYear, parse, setDate, setHours, setMinutes, setMonth, setSeconds, setTime, setYear, toGMTString, toInstant, toLocaleString, UTC
-
Constructor Details
-
Date
public Date()Creates a new Date with the current time. -
Date
public Date(long timestamp) Creates a new Date with the provided timestamp.- Parameters:
timestamp- The timestamp in milliseconds.
-
Date
Creates a new Date with the provided timestamp and timezone.- Parameters:
timestamp- The timestamp in milliseconds.zone- The timezone to use.
-
-
Method Details
-
now
Get a new Date with the current time- Returns:
- New date with the current time
-
fromJavaDate
-
add
-
subtract
-
difference
-
plus
-
minus
-
getTimestamp
Deprecated, for removal: This API element is subject to removal in a future version.UseDate.getTime()instead. -
hashCode
-
equals
-
toString
-
Date.getTime()instead.