Commit fdea1153 authored by Filipe de Lima Brito's avatar Filipe de Lima Brito

Add getTime method.

parent 4b68973c
......@@ -35,6 +35,17 @@ object DateTimeHelper {
}
}
/**
* Returns a time from a LocalDateTime.
*
* @param localDateTime The LocalDateTime.
* @return The time from a LocalDateTime.
*/
fun getTime(localDateTime: LocalDateTime): String {
val formatter = DateTimeFormatter.ofLocalizedTime(FormatStyle.SHORT)
return localDateTime.toLocalTime().format(formatter).toString()
}
private fun formatDate(localDate: LocalDate): String {
val formatter = DateTimeFormatter.ofLocalizedDate(FormatStyle.SHORT)
return localDate.format(formatter).toString()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment