Time

data class Time(var hours: Int = 0, var minutes: Int = 0, var seconds: Int = 0, var milliseconds: Int = 0, var isNegative: Boolean = false)

A class that represents a numeric time. Times that represent a time of day are stored as java.util.Dates in this API. The time class is used to represent numeric time such as the time in hours, minutes, seconds and milliseconds of a com.kosherjava.zmanim.AstronomicalCalendar.temporalHour.

This is a data class so that it inherits the copy method, and to semantically signify it is a data holder.

Author

Eliyahu Hershfeld 2004 - 2020

Constructors

Link copied to clipboard
constructor(hours: Int = 0, minutes: Int = 0, seconds: Int = 0, milliseconds: Int = 0, isNegative: Boolean = false)
constructor(millis: Double)

Constructor with a parameter for milliseconds. This constructor casts the milliseconds to an int and calls a secondary constructo

constructor(millis: Int)

A constructor that sets the time by milliseconds. The milliseconds are converted to hours, minutes, seconds and milliseconds. If the milliseconds are negative it will set isNegative to true.

Types

Link copied to clipboard
object Companion

Properties

Link copied to clipboard
var hours: Int
Link copied to clipboard
var isNegative: Boolean

Does the time represent a negative time 9such as using this to subtract time from another Time. True if the time is negative.

Link copied to clipboard
var milliseconds: Int
Link copied to clipboard
var minutes: Int
Link copied to clipboard
var seconds: Int
Link copied to clipboard
val time: Double

Returns the time in milliseconds by converting hours, minutes and seconds into milliseconds.