getFormattedTimeInEnglish
fun getFormattedTimeInEnglish(simpleTime: SimpleTime, use12HourFormat: Boolean = true): String(source)
Formats a SimpleTime object into a time string in English.
Return
A formatted time string in English.
val time = SimpleTime(16, 30, 0, 0)
val englishTime12Hour = getFormattedTimeInEnglish(time) // Output: "4:30 PM"
val englishTime24Hour = getFormattedTimeInEnglish(time, false) // Output: "16:30"Content copied to clipboard
Parameters
simpleTime
The SimpleTime object to format.
use12HourFormat
If true, the time will be formatted in 12-hour format (e.g., "09:45 AM"). If false, the time will be formatted in 24-hour format (e.g., "21:45").