Stay organized with collections
Save and categorize content based on your preferences.
DateInterval
class DateInterval : Serializable
This class represents date interval. It is a pair of long representing from date 1 to date 2.
Summary
Public constructors |
Constructor given from date and to date.
|
Public methods |
Boolean |
Override equals
|
Long |
Get the from date.
|
Long |
Get the to date.
|
Int |
Override hashcode
|
String |
Override toString
|
Public constructors
DateInterval
DateInterval(
from: Long,
to: Long)
Constructor given from date and to date.
Parameters |
from |
Long: The from date in date interval. |
to |
Long: The to date in date interval. |
Public methods
equals
fun equals(other: Any?): Boolean
Override equals
Parameters |
obj |
the reference object with which to compare. |
Return |
Boolean |
true if this object is the same as the obj argument; false otherwise. |
getFromDate
fun getFromDate(): Long
Get the from date.
Return |
Long |
the from date in dateInterval. |
getToDate
fun getToDate(): Long
Get the to date.
Return |
Long |
the to date in dateInterval. |
hashCode
fun hashCode(): Int
Override hashcode
Return |
Int |
a hash code value for this object. |
toString
fun toString(): String
Override toString
Return |
String |
a string representation of the object. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# DateInterval\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDateInterval\n============\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/icu/util/DateInterval \"View this page in Java\") \n\n```\nclass DateInterval : Serializable\n```\n\n|---|------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.icu.util.DateInterval](#) |\n\nThis class represents date interval. It is a pair of long representing from date 1 to date 2.\n\nSummary\n-------\n\n| Public constructors ||\n|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [DateInterval](#DateInterval(kotlin.Long,%20kotlin.Long))`(`from:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`, `to:` `[Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html)`)` Constructor given from date and to date. |\n\n| Public methods ||\n|------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [equals](#equals(kotlin.Any))`(`other:` `[Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html)?`)` Override equals |\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | [getFromDate](#getFromDate())`()` Get the from date. |\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | [getToDate](#getToDate())`()` Get the to date. |\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [hashCode](#hashCode())`()` Override hashcode |\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | [toString](#toString())`()` Override toString |\n\nPublic constructors\n-------------------\n\n### DateInterval\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nDateInterval(\n from: Long, \n to: Long)\n```\n\nConstructor given from date and to date.\n\n| Parameters ||\n|--------|---------------------------------------------------------------------------------------------------------------|\n| `from` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): The from date in date interval. |\n| `to` | [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html): The to date in date interval. |\n\nPublic methods\n--------------\n\n### equals\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun equals(other: Any?): Boolean\n```\n\nOverride equals\n\n| Parameters ||\n|-------|---------------------------------------------|\n| `obj` | the reference object with which to compare. |\n\n| Return ||\n|------------------------------------------------------------------------------------|---------------------------------------------------------------------------|\n| [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | `true` if this object is the same as the obj argument; `false` otherwise. |\n\n### getFromDate\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getFromDate(): Long\n```\n\nGet the from date.\n\n| Return ||\n|------------------------------------------------------------------------------|--------------------------------|\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | the from date in dateInterval. |\n\n### getToDate\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun getToDate(): Long\n```\n\nGet the to date.\n\n| Return ||\n|------------------------------------------------------------------------------|------------------------------|\n| [Long](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-long/index.html) | the to date in dateInterval. |\n\n### hashCode\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun hashCode(): Int\n```\n\nOverride hashcode\n\n| Return ||\n|----------------------------------------------------------------------------|------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | a hash code value for this object. |\n\n### toString\n\nAdded in [API level 24](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nfun toString(): String\n```\n\nOverride toString\n\n| Return ||\n|----------------------------------------------------------------------------------|----------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html) | a string representation of the object. |"]]