addDateTimePattern

open fun addDateTimePattern(pattern: String)

Deprecated (with error)

This function is deprecated in favor of `addDateTimeFormat` built on kotlinx-datetime. Alternatively, use `addJavaDateTimePattern` for Java-based parsing. Will be ERROR in 1.0.

Replace with

addDateTimeUnicodePattern<LocalDateTime>(pattern)

Deprecated:

We recommend using addDateTimeFormat instead, built on kotlinx-datetime. This provides a good DSL.

For example:

DataFrame.parser.addDateTimeFormat(
LocalDate.Format {
monthNumber(padding = Padding.SPACE); char('/'); day(); char(' '); year()
},
)

We do allow parsing by pattern too, but it requires an Opt-In and the exact type this pattern belongs to:

@OptIn(FormatStringsInDatetimeFormats::class)
DataFrame.parser.addDateTimeUnicodePattern<LocalDate>("MM/dd yyyy")

If you want to keep using the Java-based date-time parsing, you can use addJavaDateTimePattern.

For more information: See Parsing Date-time Strings on the documentation website.