DateUtils

open class DateUtils

A class with static util methods.

Functions

Link copied to clipboard
open fun formatDate(timeInMillis: Long): String
Formats timestamp to 'date month' format (e.g.
Link copied to clipboard
open fun formatDate2(timeInMillis: Long): String
Formats timestamp to 'date month' format (e.g.
Link copied to clipboard
open fun formatDate3(timeInMillis: Long): String
Formats timestamp to 'month/date/year' format (e.g.
Link copied to clipboard
open fun formatDate4(timeInMillis: Long): String
Formats timestamp to 'date month, year' format (e.g.
Link copied to clipboard
open fun formatDateTime(@NonNull context: Context, timeInMillis: Long): String
If the given time is of a different date, display the date.
Link copied to clipboard
open fun formatTime(@NonNull context: Context, timeInMillis: Long): String
Link copied to clipboard
open fun formatTimelineMessage(timeInMillis: Long): String
Link copied to clipboard
open fun getDateString(dateMillis: Long): String
Link copied to clipboard
open fun getTimeDiff(time: Long): String
Get time the difference.
Link copied to clipboard
open fun hasSameDate(millisFirst: Long, millisSecond: Long): Boolean
Checks if two dates are of the same day.
Link copied to clipboard
open fun hasSameTimeInMinute(millisFirst: Long, millisSecond: Long): Boolean
Checks if two dates are of the same time up to the minute.
Link copied to clipboard
open fun isThisYear(timeInMillis: Long): Boolean
Link copied to clipboard
open fun isToday(timeInMillis: Long): Boolean
Returns whether the given date is today, based on the user's current locale.
Link copied to clipboard
open fun isYesterday(timeInMillis: Long): Boolean