Class Time
java.lang.Object
io.github.syst3ms.skriptparser.util.Time
- All Implemented Interfaces:
Comparable<Time>
Represents a time, as one could see on a clock.
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionvoidAdd aDurationto this time.intdifference(Time other) The duration between two given time instancesbooleanintgetHour()intintintgetTime()Get a new instance of this time with the subtracted Duration.static Timenow()The current time, as it would be visible on a clock.static Timeof(int hours, int minutes, int seconds, int millis) A time instance from given values.static Timeof(SkriptDate date) A time instance from a given date.static TimeA time instance from a given LocalTime instance.Parses a given string as a time, using one of the three patterns.Get a new instance of this time with the added Duration.voidSubtract aDurationfrom this time.inttoMillis()toString()
-
Field Details
-
TIME_FORMAT
- See Also:
-
TIME_LOCALE
-
LATEST
Returns the latest possible time, being 23:59:59.999. -
MIDNIGHT
Represents midnight, at 12 PM. -
NOON
Represents noon, at 12 AM.
-
-
Method Details
-
now
The current time, as it would be visible on a clock.- Returns:
- the current time
-
of
A time instance from given values.- Parameters:
hours- the hours, between 0 and 23minutes- the minutes, between 0 and 59seconds- the seconds, between 0 and 59millis- the milliseconds, between 0 and 999- Returns:
- a new time instance
-
of
-
of
A time instance from a given date.- Parameters:
date- the date- Returns:
- a new time instance
-
parse
-
getHour
public int getHour() -
getMinute
public int getMinute() -
getSecond
public int getSecond() -
getMillis
public int getMillis() -
getTime
-
toMillis
public int toMillis()- Returns:
- the amount of milliseconds that passed since the start of the day
-
difference
-
add
-
subtract
-
plus
-
minus
-
compareTo
- Specified by:
compareToin interfaceComparable<Time>
-
equals
-
toString
-