Stay organized with collections
Save and categorize content based on your preferences.
DateTimeParseException
open class DateTimeParseException : DateTimeException
An exception thrown when an error occurs during parsing.
This exception includes the text being parsed and the error index.
Summary
Public constructors |
Constructs a new exception with the specified message.
|
Constructs a new exception with the specified message and cause.
|
Public methods |
open Int |
Returns the index where the error was found.
|
open String! |
Returns the string that was being parsed.
|
Public constructors
DateTimeParseException
DateTimeParseException(
message: String!,
parsedData: CharSequence!,
errorIndex: Int)
Constructs a new exception with the specified message.
Parameters |
message |
String!: the message to use for this exception, may be null |
parsedData |
CharSequence!: the parsed text, should not be null |
errorIndex |
Int: the index in the parsed string that was invalid, should be a valid index |
DateTimeParseException
DateTimeParseException(
message: String!,
parsedData: CharSequence!,
errorIndex: Int,
cause: Throwable!)
Constructs a new exception with the specified message and cause.
Parameters |
message |
String!: the message to use for this exception, may be null |
parsedData |
CharSequence!: the parsed text, should not be null |
errorIndex |
Int: the index in the parsed string that was invalid, should be a valid index |
cause |
Throwable!: the cause exception, may be null |
Public methods
getErrorIndex
open fun getErrorIndex(): Int
Returns the index where the error was found.
Return |
Int |
the index in the parsed string that was invalid, should be a valid index |
getParsedString
open fun getParsedString(): String!
Returns the string that was being parsed.
Return |
String! |
the string that was being parsed, should not 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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# DateTimeParseException\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nDateTimeParseException\n======================\n\n```\nopen class DateTimeParseException : DateTimeException\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](../DateTimeException.html#) ||\n| | | | | ↳ | [java.time.format.DateTimeParseException](#) |\n\nAn exception thrown when an error occurs during parsing.\n\nThis exception includes the text being parsed and the error index.\n\nSummary\n-------\n\n| Public constructors ||\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [DateTimeParseException](#DateTimeParseException(kotlin.String,%20kotlin.CharSequence,%20kotlin.Int))`(`message:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `parsedData:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`, `errorIndex:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Constructs a new exception with the specified message. |\n| [DateTimeParseException](#DateTimeParseException(kotlin.String,%20kotlin.CharSequence,%20kotlin.Int,%20kotlin.Throwable))`(`message:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`, `parsedData:` `[CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!`, `errorIndex:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`, `cause:` `[Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)!`)` Constructs a new exception with the specified message and cause. |\n\n| Public methods ||\n|----------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------|\n| open [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | [getErrorIndex](#getErrorIndex())`()` Returns the index where the error was found. |\n| open [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | [getParsedString](#getParsedString())`()` Returns the string that was being parsed. |\n\nPublic constructors\n-------------------\n\n### DateTimeParseException\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nDateTimeParseException(\n message: String!, \n parsedData: CharSequence!, \n errorIndex: Int)\n```\n\nConstructs a new 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| `parsedData` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!: the parsed text, should not be null |\n| `errorIndex` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the index in the parsed string that was invalid, should be a valid index |\n\n### DateTimeParseException\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nDateTimeParseException(\n message: String!, \n parsedData: CharSequence!, \n errorIndex: Int, \n cause: Throwable!)\n```\n\nConstructs a new 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| `parsedData` | [CharSequence](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-char-sequence/index.html)!: the parsed text, should not be null |\n| `errorIndex` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the index in the parsed string that was invalid, should be a valid index |\n| `cause` | [Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html)!: the cause exception, may be null |\n\nPublic methods\n--------------\n\n### getErrorIndex\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getErrorIndex(): Int\n```\n\nReturns the index where the error was found.\n\n| Return ||\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------|\n| [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html) | the index in the parsed string that was invalid, should be a valid index |\n\n### getParsedString\n\nAdded in [API level 26](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun getParsedString(): String!\n```\n\nReturns the string that was being parsed.\n\n| Return ||\n|-----------------------------------------------------------------------------------|-------------------------------------------------------|\n| [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)! | the string that was being parsed, should not be null. |"]]