LocalDate

open class LocalDate: DataValue

Represents the XML Schema date type without zone offset.

  • Declaration

    Swift

    public static func from(utc date: Date, in timeZone: TimeZone = GMT) -> LocalDate

    Parameters

    utc

    UTC-based point in time.

    timeZone

    Time zone in which the local date will be determined (defaults to GMT). Use TimeZone.current for the local time zone.

    Return Value

    Local date equivalent of UTC-based point in time.

  • Compare two date values.

    Declaration

    Swift

    open class func compare(_ left: LocalDate, _ right: LocalDate) -> Int

    Parameters

    left

    The first date for comparison.

    right

    The second date for comparison.

    Return Value

    -1 if left < right, 0 if left == right, or 1 if left > right.

  • Compare this date with another date.

    Declaration

    Swift

    open func compareTo(_ value: LocalDate) -> Int

    Parameters

    value

    The other date.

    Return Value

    -1 if this date is less than the value date, 0 if they are equal, 1 if this date is greater than the value date.

  • Data type of the wrapped value.

    Declaration

    Swift

    override open var dataType: DataType
  • day

    Day field of date (1 to 31).

    Declaration

    Swift

    open var day: Int
  • Day of week (1 to 7).

    See also

    DayOfWeek.

    Declaration

    Swift

    open var dayOfWeek: Int
  • Day of year (1 to 366).

    Declaration

    Swift

    open var dayOfYear: Int
  • Compare two date values.

    Declaration

    Swift

    open class func equal(_ left: LocalDate?, _ right: LocalDate?) -> Bool

    Parameters

    left

    The first date for comparison.

    right

    The second date for comparison.

    Return Value

    true if left is equal to right, otherwise false.

  • Compare this date value with another date value.

    Declaration

    Swift

    override open func equals(_ value: AnyObject?) -> Bool

    Parameters

    value

    The other date value.

    Return Value

    True, if this date value is equal to the value date value. Otherwise false.

  • Compare this date value with another date value.

    Declaration

    Swift

    open func greaterEqual(_ value: LocalDate) -> Bool

    Parameters

    value

    The other date value.

    Return Value

    true if this date value is greater than or equal to the value date value. Oherwise false.

  • Compare two date values.

    Declaration

    Swift

    open class func greaterEqual(_ left: LocalDate, _ right: LocalDate) -> Bool

    Parameters

    left

    The first date for comparison.

    right

    The second date for comparison.

    Return Value

    true if left is greater than or equal to right, otherwise false.

  • Compare this date value with another date value.

    Declaration

    Swift

    open func greaterThan(_ value: LocalDate) -> Bool

    Parameters

    value

    The other date value.

    Return Value

    true if this date value is greater than the value date value. Oherwise false.

  • Compare two date values.

    Declaration

    Swift

    open class func greaterThan(_ left: LocalDate, _ right: LocalDate) -> Bool

    Parameters

    left

    The first date for comparison.

    right

    The second date for comparison.

    Return Value

    true if left is greater than right, otherwise false.

  • Hash this data value to a number.

    Declaration

    Swift

    override open func hashCode() -> Int

    Return Value

    Any value in the range of type int.

  • Compare this date value with another date value.

    Declaration

    Swift

    open func lessEqual(_ value: LocalDate) -> Bool

    Parameters

    value

    The other date value.

    Return Value

    true if this date value is less than or equal to the value date value. Oherwise false.

  • Compare two date values.

    Declaration

    Swift

    open class func lessEqual(_ left: LocalDate, _ right: LocalDate) -> Bool

    Parameters

    left

    The first date for comparison.

    right

    The second date for comparison.

    Return Value

    true if left is less than or equal to right, otherwise false.

  • Compare this date value with another date value.

    Declaration

    Swift

    open func lessThan(_ value: LocalDate) -> Bool

    Parameters

    value

    The other date value.

    Return Value

    true if this date value is less than the value date value. Oherwise false.

  • Compare two date values.

    Declaration

    Swift

    open class func lessThan(_ left: LocalDate, _ right: LocalDate) -> Bool

    Parameters

    left

    The first date for comparison.

    right

    The second date for comparison.

    Return Value

    true if left is less than right, otherwise false.

  • Declaration

    Swift

    open func minus(_ value: LocalDate) -> Double

    Parameters

    value

    The other date.

    Return Value

    The difference this - value, measured in days.

  • Month field of date (1 to 12).

    See also

    MonthOfYear.

    Declaration

    Swift

    open var month: Int
  • Compare this date value with another date value.

    Declaration

    Swift

    open func notEqual(_ value: LocalDate) -> Bool

    Parameters

    value

    The other date value.

    Return Value

    true if this date value is not equal to the value date value. Oherwise false.

  • Compare two date values.

    Declaration

    Swift

    open class func notEqual(_ left: LocalDate?, _ right: LocalDate?) -> Bool

    Parameters

    left

    The first date for comparison.

    right

    The second date for comparison.

    Return Value

    true if left is not equal to right, otherwise false.

  • Declaration

    Swift

    open class func now() -> LocalDate

    Return Value

    The current local date.

  • Declaration

    Swift

    open class func of(year: Int, month: Int, day: Int) -> LocalDate

    Parameters

    year

    The year field.

    month

    The month field (1 to 12).

    day

    The day field (1 to 31).

    Return Value

    A new date value.

  • Declaration

    Swift

    open class func parse(_ text: String) -> LocalDate?

    Parameters

    text

    Value in XML Schema format.

    Return Value

    Value parsed from XML Schema format, or nil if text has invalid date format.

  • Declaration

    Swift

    open func plusDays(_ days: Int) -> LocalDate

    Parameters

    days

    Number of days to add. Can be negative, zero or positive.

    Return Value

    A new date which is the specified number of days ahead of this date.

  • Declaration

    Swift

    open func plusMonths(_ months: Int) -> LocalDate

    Parameters

    months

    Number of months to add. Can be negative, zero or positive.

    Return Value

    A new date which is which is the specified number of months ahead of this date.

  • Declaration

    Swift

    open func plusWeeks(_ weeks: Int) -> LocalDate

    Parameters

    weeks

    Number of weeks to add. Can be negative, zero or positive.

    Return Value

    A new date which is which is the specified number of weeks ahead of this date.

  • Declaration

    Swift

    open func plusYears(_ years: Int) -> LocalDate

    Parameters

    years

    Number of years to add. Can be negative, zero or positive.

    Return Value

    A new date which is which is the specified number of years ahead of this date.

  • Convert this data value to a string. If the dataType is defined by XML Schema Part 2: Datatypes, then the corresponding lexical format is used. JSON format is used for structured values (arrays and objects).

    Declaration

    Swift

    override open func toString() -> String

    Return Value

    Lexical representation of this data value.

  • Year field of date.

    Declaration

    Swift

    open var year: Int