DateExtension

DateExtension contains extension function to manipulate Date formatting and parsing

Author

jimlyas

Since

16 Jan 2023

Copyright © 2022-2023 jimlyas. All rights reserved.

Functions

Link copied to clipboard
fun Long.toDate(toFormat: String, locale: Locale = Locale.getDefault()): String

Extension function of Long to parse unix timestamp as String in the form of Date

fun String.toDate(fromFormat: String, locale: Locale = Locale.getDefault()): Date

Extension function of String to parse String as a Date

Link copied to clipboard
fun Date.toString(toFormat: String, locale: Locale = Locale.getDefault()): String

Extension function of DateExtension to format Date to a String