class MutableDateTime : DateTime
MutableDateTime is a mutable subclass of DateTime.
See DateTime for specific details.
MutableDateTime(timeZoneId: String? = null)
Constructs a new MutableDateTime object using specified time zone. MutableDateTime(calendar: Calendar)
Constructs a new MutableDateTime object based on specified calendar instance. MutableDateTime(dateTime: DateTime)
Constructs a new MutableDateTime object based on specified dateTime instance. MutableDateTime(millis: Long, timeZoneId: String? = null)
Constructs a new MutableDateTime object with specified number of milliseconds since epoch. MutableDateTime(year: Int, month: Int, day: Int, hours: Int = 0, minutes: Int = 0, seconds: Int = 0, milliseconds: Int = 0, timeZoneId: String? = null)
Constructs a new MutableDateTime object with specified year, month and day, and optionally hours, minutes, seconds and milliseconds. |
var day: Int
Gets/sets day of month - first day is 1. |
|
var dayOfWeek: Int
Gets/sets day of week - constants are identical to those used by Calendar. |
|
var hour: Int
Gets/sets hour within day - between 0 to 23. |
|
var milli: Int
Gets/sets millisecond within second. |
|
var millis: Long
Gets/sets time in milliseconds since epoch. |
|
var minute: Int
Gets/sets minute within hour. |
|
var month: Int
Gets/sets month of year - first month is 1. |
|
var second: Int
Gets/sets second within minute. |
|
var timeZoneId: String
Gets/sets the timezone id for the instance. |
|
var year: Int
Gets/sets year. |
fun addDays(value: Int): Unit
Updates MutableDateTime instance by adding value to day component. Value may be negative. |
|
fun addHours(value: Int): Unit
Updates MutableDateTime instance by adding value to hour component. Value may be negative. |
|
fun addMillis(value: Int): Unit
Updates MutableDateTime instance by adding value to millisecond component. Value may be negative. |
|
fun addMinutes(value: Int): Unit
Updates MutableDateTime instance by adding value to minute component. Value may be negative. |
|
fun addMonths(value: Int): Unit
Updates MutableDateTime instance by adding value to month component. Value may be negative. |
|
fun addSeconds(value: Int): Unit
Updates MutableDateTime instance by adding value to second component. Value may be negative. |
|
fun addYears(value: Int): Unit
Updates MutableDateTime instance by adding value to year component. Value may be negative. |
|
fun toImmutable(): DateTime
Returns an immutable version of the instance. |
|
fun toMutable(): MutableDateTime
Because MutableDateTime itself is mutable, returns the receiver instance. |
|
fun truncateTime(): Unit
Updates MutableDateTime instance by setting hour, minute, second and millisecond components to zero. |
fun addedDays(value: Int): DateTime
Returns an instance of DateTime resulting from adding value to day component. Value may be negative. |
|
fun addedHours(value: Int): DateTime
Returns an instance of DateTime resulting from adding value to hour component. Value may be negative. |
|
fun addedMillis(value: Int): DateTime
Returns an instance of DateTime resulting from adding value to millisecond component. Value may be negative. |
|
fun addedMinutes(value: Int): DateTime
Returns an instance of DateTime resulting from adding value to minute component. Value may be negative. |
|
fun addedMonths(value: Int): DateTime
Returns an instance of DateTime resulting from adding value to month component. Value may be negative. |
|
fun addedSeconds(value: Int): DateTime
Returns an instance of DateTime resulting from adding value to second component. Value may be negative. |
|
fun addedYears(value: Int): DateTime
Returns an instance of DateTime resulting from adding value to year component. Value may be negative. |
|
infix fun after(other: DateTime): Boolean infix fun after(other: Calendar): Boolean
Returns true if receiver falls after other. infix fun after(other: Long): Boolean
Returns true if receiver falls after other - given in milliseconds since epoch. |
|
infix fun before(other: DateTime): Boolean infix fun before(other: Calendar): Boolean
Returns true if receiver falls before other. infix fun before(other: Long): Boolean
Returns true if receiver falls before other - given in milliseconds since epoch. |
|
fun compareTo(other: Calendar): Int
Returns -1, 0, 1 if the instance is less than, equal to, or greater than specified Calendar instance, respectively. fun compareTo(other: Long): Int
Returns -1, 0, 1 if the instance is less than, equal to, or greater than specified number of milliseconds from epoch, respectively. open fun compareTo(other: DateTime): Int
Returns -1, 0, 1 if the instance is less than, equal to, or greater than other instance, respectively. |
|
operator fun component1(): Int
Returns year as the first component. |
|
operator fun component2(): Int
Returns month as the second component. |
|
operator fun component3(): Int
Returns day of month as the third component. |
|
operator fun component4(): Int
Returns hour of day as the fourth component. |
|
operator fun component5(): Int
Returns minute of hour as the fifth component. |
|
operator fun component6(): Int
Returns second of minute as the sixth component. |
|
operator fun component7(): Int
Returns millisecond of minute as the seventh component. |
|
open fun describeContents(): Int
Returns zero. |
|
open fun equals(other: Any?): Boolean
Returns true if the specified DateTime, Calendar, or Long (number of milliseconds from epoch) is equal to instance. |
|
open fun hashCode(): Int
Returns hash code of the instance - which is equal to its Calendar's hashCode value. |
|
infix fun on(other: DateTime): Boolean infix fun on(other: Calendar): Boolean infix fun on(other: Long): Boolean
Returns true if receiver represents the same time as other. |
|
infix fun onOrAfter(other: DateTime): Boolean infix fun onOrAfter(other: Calendar): Boolean
Returns true if receiver falls on or after other. infix fun onOrAfter(other: Long): Boolean
Returns true if receiver falls on or after other - given in milliseconds since epoch. |
|
infix fun onOrBefore(other: DateTime): Boolean infix fun onOrBefore(other: Calendar): Boolean
Returns true if receiver falls on or before other. infix fun onOrBefore(other: Long): Boolean
Returns true if receiver falls on or before other - given in milliseconds since epoch. |
|
fun toCalendar(): Calendar
Returns a clone of the Calendar object. |
|
fun toString(format: String, timeZoneId: String? = null): String
Returns a string representation of DateTime instance in specified format and optionally, time zone. fun toString(format: DateFormat): String
Returns a string representation of DateTime instance in specified DateFormat. open fun toString(): String
Returns a string representation of DateTime instance in RFC-3339 format, in UTC - e.g. "1983-07-15T08:00:59Z". |
|
fun toTimeZone(timeZoneId: String?): DateTime
Returns the DateTime instance in specified time zone. |
|
fun toUTC(): DateTime
Returns UTC representation of the DateTime instance. |
|
fun truncatedTime(): DateTime
Returns an instance of DateTime with hour, minute, second and millisecond components set to zero. |
|
open fun writeToParcel(dest: Parcel, flags: Int): Unit
Implements Parcelable.writeToParcel by writing number of milliseconds since epoch and time zone id. |
val CREATOR: Creator<MutableDateTime>
Implementation of Parcelable.Creator. |
|
val now: MutableDateTime
Returns MutableDateTime instance representing current time and date. |
|
val today: MutableDateTime
Returns MutableDateTime instance representing date. Time components will be set to zero. |
fun parse(string: String, format: DateFormat): MutableDateTime
Parses string in specified format and returns a MutableDateTime instance. |
|
fun tryParse(string: String, format: DateFormat): MutableDateTime?
Parses string in specified format and returns a MutableDateTime instance, or null if parsing fails. |