Stay organized with collections
Save and categorize content based on your preferences.
DateTimeException
open class DateTimeException : RuntimeException
Exception used to indicate a problem while calculating a date-time.
This exception is used to indicate problems with creating, querying and manipulating date-time objects.
Summary
Public constructors |
Constructs a new date-time exception with the specified message.
|
Constructs a new date-time exception with the specified message and cause.
|
Public constructors
DateTimeException
DateTimeException(message: String!)
Constructs a new date-time exception with the specified message.
Parameters |
message |
String!: the message to use for this exception, may be null |
DateTimeException
DateTimeException(
message: String!,
cause: Throwable!)
Constructs a new date-time exception with the specified message and cause.
Parameters |
message |
String!: the message to use for this exception, may be null |
cause |
Throwable!: the cause of the exception, may be null |
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,["# DateTimeException\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDateTimeException\n=================\n\n```\nopen class DateTimeException : RuntimeException\n```\n\n|---|---|---|---|----------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) |||||\n| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) ||||\n| | ↳ | [java.lang.Exception](../lang/Exception.html#) |||\n| | | ↳ | [java.lang.RuntimeException](../lang/RuntimeException.html#) ||\n| | | | ↳ | [java.time.DateTimeException](#) |\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [DateTimeParseException](/reference/kotlin/java/time/format/DateTimeParseException), [UnsupportedTemporalTypeException](/reference/kotlin/java/time/temporal/UnsupportedTemporalTypeException), [ZoneRulesException](/reference/kotlin/java/time/zone/ZoneRulesException) |-----------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------| | [DateTimeParseException](/reference/kotlin/java/time/format/DateTimeParseException) | An exception thrown when an error occurs during parsing. | | [UnsupportedTemporalTypeException](/reference/kotlin/java/time/temporal/UnsupportedTemporalTypeException) | UnsupportedTemporalTypeException indicates that a ChronoField or ChronoUnit is not supported for a Temporal class. | | [ZoneRulesException](/reference/kotlin/java/time/zone/ZoneRulesException) | Thrown to indicate a problem with time-zone configuration. | |\n\nException used to indicate a problem while calculating a date-time.\n\nThis exception is used to indicate problems with creating, querying and manipulating date-time objects.\n\nSummary\n-------\n\n| Public constructors ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [DateTimeException](#DateTimeException(kotlin.String))`(`message:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Constructs a new date-time exception with the specified message. |\n| [DateTimeException](#DateTimeException(kotlin.String,%20kotlin.Throwable))`(`message:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `cause:` `[Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)!`)` Constructs a new date-time exception with the specified message and cause. |\n\nPublic constructors\n-------------------\n\n### DateTimeException\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nDateTimeException(message: String!)\n```\n\nConstructs a new date-time exception with the specified message.\n\n| Parameters ||\n|-----------|---------------------------------------------------------------------------------------------------------------------------------------|\n| `message` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: the message to use for this exception, may be null |\n\n### DateTimeException\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nDateTimeException(\n message: String!, \n cause: Throwable!)\n```\n\nConstructs a new date-time exception with the specified message and cause.\n\n| Parameters ||\n|-----------|---------------------------------------------------------------------------------------------------------------------------------------|\n| `message` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: the message to use for this exception, may be null |\n| `cause` | [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)!: the cause of the exception, may be null |"]]