Format date from integer type

 fun formatDate(date: Int): String {

        return SimpleDateFormat("dd MMMM yyyy")
            .format(Date(date * 1000L))
    }

    fun formatMonthYear(date: Int): String {

        return SimpleDateFormat("MMMM yyyy")
            .format(Date(date * 1000L))
    }
 fun formatDate(date: LocalDate): String {

        val formatter = DateTimeFormatter.ofPattern("dd MMMM yyyy")

        return date.format(formatter)
    }
fun formatDate(date: Calendar): String {
        val formatter = SimpleDateFormat("dd MMMM yyyy")
        return formatter.format(date.time)
    }

Post Suggeriti