Package-level declarations

Properties

Link copied to clipboard

Constant to perform the time formatting as follows: "HH:mm 'H'" For example: "21:02 hrs"

Link copied to clipboard

Constant to perform the date formatting as follows: "dd/MM/yyyy HH:mm" For example: "04/07/2022 21:02"

Link copied to clipboard

Constant to perform the date formatting as follows: "dd/MM/yyyy" For example: "04/07/2022"

Link copied to clipboard

Constant to perform the time formatting as follows: "EEEE, MMMM d, yyyy - hh:mm:ss a" For example: "21:02 hrs"

Functions

Link copied to clipboard
fun Date.add(field: Int, amount: Int): Date

Add field date to current date

Link copied to clipboard
fun Date.addDays(days: Int): Date
Link copied to clipboard
fun Date.addHours(hours: Int): Date
Link copied to clipboard
fun Date.addMinutes(minutes: Int): Date
Link copied to clipboard
fun Date.addMonths(months: Int): Date
Link copied to clipboard
fun Date.addSeconds(seconds: Int): Date
Link copied to clipboard
fun Date.addYears(years: Int): Date
Link copied to clipboard
fun Date.backInYears(years: Int): Date
Link copied to clipboard
fun Date.diffInDays(next: Date): Long
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

---- FORMATS -------------------------------------------------------------------------------

Link copied to clipboard
Link copied to clipboard

Pattern: yyyy-MM-dd

Link copied to clipboard

Pattern: yyyy-MM-dd HH:mm:ss

Link copied to clipboard

Pattern: HH:mm:ss

Link copied to clipboard

Pattern: dd/MM/yyyy

Link copied to clipboard

Pattern: dd/MM/yyyy HH:mm:ss

Link copied to clipboard

Pattern: HH:mm:ss

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
fun Date.getDateTime(daysNumber: Int): Date
Link copied to clipboard
Link copied to clipboard
fun Date.isAfterOrEqualThan(numberDaysBeforeToday: Int, now: Date? = null): Boolean
Link copied to clipboard
fun Date.isBeforeThan(numberDaysBeforeToday: Int, now: Date? = null): Boolean
Link copied to clipboard
fun Date.minusDays(days: Int): Date
Link copied to clipboard
fun Date.plusDays(days: Int): Date
Link copied to clipboard
fun Date.plusMinutes(minutes: Int): Date
Link copied to clipboard
Link copied to clipboard

---- CALENDAR ------------------------------------------------------------------------------

Link copied to clipboard

Convert time in seconds to hh:mm:ss or mm:ss