DateUtils
Date/time parsing, formatting, and arithmetic helpers shared across all Kotlin targets.
Formatters render US-style MM/DD dates; the *Now helpers default to the system time zone rather than assuming a region. Declared as an object so its extensions are brought in by member import (e.g. import com.pambrose.common.util.DateUtils.toMMDDYY).
Properties
Functions
Returns the abbreviated day-of-week name (e.g., "Mon", "Tue").
Returns the current moment from the system clock as an Instant.
The current date in timeZone (the system default zone unless specified).
The current date-time in timeZone (the system default zone unless specified).
Parses this ISO-8601 date string (e.g. "2024-03-15") into a LocalDate.
Parses this ISO-8601 date-time string (e.g. "2024-03-15T08:30:45") into a LocalDateTime.
Parses this ISO-8601 time string (e.g. "13:45:30") into a LocalTime.
Truncates this Duration down to whole units and returns its Duration.toString form.
Wraps toMMDDYYYYHHMM in a "(Created …)" label, e.g. "(Created 04/10/2026 14:30)".
Formats this LocalDate as ISO-style YYYY-MM-DD, e.g. "2026-04-10".
Formats this LocalDateTime as a full date string, e.g., "Mon 04/10/26 14:30:00".
Formats this LocalDateTime as a full date string suffixed with the UTC offset for timeZone, e.g., "Mon 04/10/26 14:30:00 -04:00" (a zero offset renders as "Z").
Formats this LocalDateTime as a log-friendly timestamp with milliseconds, e.g. "04/10/26 14:30:45.123" (MM/DD/YY HH:MM:SS.mmm).
Formats this LocalDate as MM/DD/YYYY, e.g. "04/10/2026".
Formats this LocalDateTime as MM/DD/YYYY HH:MM, e.g. "04/10/2026 14:30".
Returns the last minute of this LocalDate in UTC, i.e. 23:59:00.001 of the same day.