toDateTimeComponents

fun <T> Convert<T, String?>.toDateTimeComponents(format: DateTimeFormat<DateTimeComponents>? = null): DataFrame<T>

Converts values in the String columns previously selected with convert to DateTimeComponents, preserving their original names and positions within the DataFrame. Preserves null values.

Trims each string and attempts to parse it using the specified format. Fails with an exception if a value cannot be parsed.

For more information: See convert on the documentation website.

Examples:

df.convert { timestamp }.toDateTimeComponents()

Return

A new DataFrame with the values converted to DateTimeComponents.

Parameters

format

An optional DateTimeFormat to use when parsing. If null, the defaults will be used.


@FormatStringsInDatetimeFormats
fun <T> Convert<T, String?>.toDateTimeComponents(pattern: String): DataFrame<T>

Converts values in the String columns previously selected with convert to DateTimeComponents, preserving their original names and positions within the DataFrame. Preserves null values.

Trims each string and attempts to parse it using the specified pattern. Fails with an exception if a value cannot be parsed.

For more information: See convert on the documentation website.

Examples:

df.convert { timestamp }.toDateTimeComponents()

Return

A new DataFrame with the values converted to DateTimeComponents.

Parameters

pattern

An optional date-time pattern to use for parsing.


Converts values in the columns previously selected with convert to DateTimeComponents, preserving their original names and positions within the DataFrame.

For more information: See convert on the documentation website.

Examples:

df.convert { timestamp }.toDateTimeComponents()

Return

A new DataFrame with the values converted to DateTimeComponents.