formattedDateTime

fun formattedDateTime(instant: Instant, timeZone: TimeZone = TimeZone.currentSystemDefault(), dateStyle: FormatStyle = FormatStyle.MEDIUM, timeStyle: FormatStyle = FormatStyle.MEDIUM, includeDurationFromNow: Boolean = false, durationFromNowColor: Color = MaterialTheme.colorScheme.secondary): AnnotatedString

Formats a string to display a point in time as a date and time string.

Parameters

instant

the point in time to display.

timeZone

the timezone to use for displaying the point in time.

dateStyle

the amount of data to include in the date component.

timeStyle

the amount of date to include in the time component.

includeDurationFromNow

if true, will include a textual representation of how far in the past or future the point in time is relative to the current time.

durationFromNowColor

the color to use for the duration from now component.