DateUtil

object DateUtil

Utility class for formatting dates.

Functions

Link copied to clipboard

Gets a UTC Calendar instance set to the time in milliseconds.

Link copied to clipboard
fun getFormattedDate(timeInMillis: Long, outputFormat: String): String

Formats a UTC timestamp to a string date.

fun getFormattedDate(dateString: String?, format: String, outputFormat: String, shouldReturnCurrentDateIfNull: Boolean = false, asPastDate: Boolean = false): String

Converts a string from the input format to the output format.

Link copied to clipboard

Gets a UTC Calendar instance.

Link copied to clipboard

Gets a SimpleDateFormat instance to format UTC dates.

Link copied to clipboard

Gets a UTC TimeZone instance.

Link copied to clipboard
fun parseDate(dateString: String?, format: String, shouldReturnCurrentDateIfNull: Boolean = true, shouldParseAsPastDate: Boolean = false): Long

Parses a string formatted date into a UTC timestamp.

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard