StrictDates

Strict date parsing for tool parameters.

Functions

Link copied to clipboard
fun parse(pattern: String, input: String, timeZone: TimeZone = TimeZone.getDefault()): Date?

Parses input (trimmed) with pattern in timeZone, strictly: non-lenient, so impossible dates such as 2026-02-30 or 24:00 are rejected instead of rolled over, and the whole string must be consumed (no trailing text). Null when it doesn't match.