The epsilon-formatter module provides Kotlin Multiplatform utilities for formatting dates, numbers, and strings using platform-specific implementations (e.g., java.text and java.time on JVM/Android and Foundation on iOS).
Use this module when shared code needs platform-consistent formatting behavior without adding separate formatter implementations per target.
CommonLocale which is typealiased to platform specific classes.The core utility class for performing various formatting operations. It uses platform-specific logic to ensure that formatting matches the user's expectations on each OS.
Formatter example
// Format a Unix timestamp to UTC time string
val timeString = Formatter.dateTime(
format = DateTimeFormat.TimeHoursMinutes,
unixMillisTimestamp = 1715856000000L
)Constants and utilities for common date and time patterns.
| Format | Pattern |
|---|---|
DateISO | yyyy-MM-dd |
DateTimeISO | yyyy-MM-dd'T'HH:mm:ss |
TimeHoursMinutes | HH:mm |
TimeHoursMinutesMeridiem | h:mm a |
Other patterns can be implemented in consumer projects by extending the Format interface.
Add the dependency to your commonMain:
dependencies {
implementation("ag.sportradar.mobile.epsilon:epsilon-formatter:<version>")
}