SupportDateHelper

Date helper utility

Since

v1.1.0

Constructors

Link copied to clipboard
constructor()

Properties

Link copied to clipboard
open override val currentSeason: SeasonType
Link copied to clipboard

ISO 8601 date format pattern, this default pattern targets API level Build.VERSION_CODES.N and up

Functions

Link copied to clipboard
fun convertFromUnixTimeStamp(    unixTimeStamp: Long,     locale: Locale = Locale.getDefault(),     outputDatePattern: String = defaultOutputDatePattern,     targetTimeZone: TimeZone = TimeZone.getDefault()): String

Helper utility for converting unix timestamp to a date string format

Link copied to clipboard
fun convertToTimeStamp(    originDate: String,     locale: Locale = Locale.getDefault(),     inputPattern: String = defaultInputDatePattern,     outputDatePattern: String = defaultOutputDatePattern,     targetTimeZone: TimeZone = TimeZone.getDefault()): String
fun convertToTimeStamp(    originDate: String,     locale: Locale = Locale.getDefault(),     dateTimeFormatter: DateTimeFormatter,     outputDatePattern: String = defaultOutputDatePattern,     targetTimeZone: TimeZone = TimeZone.getDefault()): String

Helper utility for converting dates in string format from one date type to the other

Link copied to clipboard
fun convertToUnixTimeStamp(    originDate: String,     dateTimeFormatter: DateTimeFormatter,     targetTimeZone: TimeZone = TimeZone.getDefault()): Long
fun convertToUnixTimeStamp(    originDate: String,     locale: Locale = Locale.getDefault(),     inputPattern: String = defaultInputDatePattern,     targetTimeZone: TimeZone = TimeZone.getDefault()): Long

Helper utility for converting dates in string format to unix time stamp

Link copied to clipboard
open override fun getCurrentYear(delta: Int): Int

Gets the current year + delta, if the season for the year is winter later in the year then the result would be the current year plus the delta