toLocalDatetime

fun String.toLocalDatetime(vararg formats: String?): LocalDateTime?

Works off of String representations of datetime and tries parsing as LocalDateTime & return null if it fails.

Return

LocalDateTime? Null means couldn't parse, else parsed LocalDateTime.

Parameters

this

String representation of LocalDateTime.

formats

Parsing formats attempted in order. Null/blank entries attempt default ISO parsing.