LocalTime

open class LocalTime : DataValue

Represents the XML Schema time type without zone offset.

  • Declaration

    Swift

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

    Parameters

    utc

    UTC-based point in time.

    timeZone

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

    Return Value

    Local time equivalent of UTC-based point in time.

  • Compare two time values.

    Declaration

    Swift

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

    Parameters

    left

    The first time for comparison.

    right

    The second time for comparison.

    Return Value

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

  • Compare this time with another time.

    Declaration

    Swift

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

    Parameters

    value

    The other time.

    Return Value

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

  • Data type of the wrapped value.

    Declaration

    Swift

    override open var dataType: DataType { get }
  • Compare two time values.

    Declaration

    Swift

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

    Parameters

    left

    The first time for comparison.

    right

    The second time for comparison.

    Return Value

    true if left is equal to right, otherwise false.

  • Compare this time value with another time value.

    Declaration

    Swift

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

    Parameters

    value

    The other time value.

    Return Value

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

  • Compare this time value with another time value.

    Declaration

    Swift

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

    Parameters

    value

    The other time value.

    Return Value

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

  • Compare two time values.

    Declaration

    Swift

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

    Parameters

    left

    The first time for comparison.

    right

    The second time for comparison.

    Return Value

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

  • Compare this time value with another time value.

    Declaration

    Swift

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

    Parameters

    value

    The other time value.

    Return Value

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

  • Compare two time values.

    Declaration

    Swift

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

    Parameters

    left

    The first time for comparison.

    right

    The second time 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.

  • Hour field of time (0 to 23).

    Declaration

    Swift

    open var hour: Int { get }
  • Compare this time value with another time value.

    Declaration

    Swift

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

    Parameters

    value

    The other time value.

    Return Value

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

  • Compare two time values.

    Declaration

    Swift

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

    Parameters

    left

    The first time for comparison.

    right

    The second time for comparison.

    Return Value

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

  • Compare this time value with another time value.

    Declaration

    Swift

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

    Parameters

    value

    The other time value.

    Return Value

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

  • Compare two time values.

    Declaration

    Swift

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

    Parameters

    left

    The first time for comparison.

    right

    The second time for comparison.

    Return Value

    true if left is less than right, otherwise false.

  • Declaration

    Swift

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

    Parameters

    value

    The other time.

    Return Value

    The difference this - value, measured in days.

  • Minute field of time (0 to 59).

    Declaration

    Swift

    open var minute: Int { get }
  • Nanosecond field of time (0 to 999999999).

    Declaration

    Swift

    open var nano: Int { get }
  • Compare this time value with another time value.

    Declaration

    Swift

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

    Parameters

    value

    The other time value.

    Return Value

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

  • Compare two time values.

    Declaration

    Swift

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

    Parameters

    left

    The first time for comparison.

    right

    The second time for comparison.

    Return Value

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

  • Declaration

    Swift

    open class func now() -> LocalTime

    Return Value

    The current local time.

  • Declaration

    Swift

    open class func of(hour: Int, minute: Int, second: Int, nano: Int = (0 as Int)) -> LocalTime

    Parameters

    hour

    The hour field (0 to 24). If the hour is 24 then all the other parameters must be 0. This represents a day duration (PT24H).

    minute

    The minute field (0 to 59).

    second

    The second field (0 to 59).

    nano

    The nano field (0 to 999999999).

    Return Value

    A new time value.

  • Declaration

    Swift

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

    Parameters

    text

    Value in XML Schema format.

    Return Value

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

  • Declaration

    Swift

    open func plusHours(_ hours: Int64) -> LocalTime

    Parameters

    hours

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

    Return Value

    A new time which is the specified number of hours ahead of this time.

  • Declaration

    Swift

    open func plusMicros(_ micros: Int64) -> LocalTime

    Parameters

    micros

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

    Return Value

    A new time which is the specified number of microseconds ahead of this time.

  • Declaration

    Swift

    open func plusMillis(_ millis: Int64) -> LocalTime

    Parameters

    millis

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

    Return Value

    A new time which is the specified number of milliseconds ahead of this time.

  • Declaration

    Swift

    open func plusMinutes(_ minutes: Int64) -> LocalTime

    Parameters

    minutes

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

    Return Value

    A new time which is the specified number of minutes ahead of this time.

  • Declaration

    Swift

    open func plusNanos(_ nanos: Int64) -> LocalTime

    Parameters

    nanos

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

    Return Value

    A new time which is the specified number of nanoseconds ahead of this time.

  • Declaration

    Swift

    open func plusSeconds(_ seconds: Int64) -> LocalTime

    Parameters

    seconds

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

    Return Value

    A new time which is the specified number of seconds ahead of this time.

  • Second field of time (0 to 59).

    Declaration

    Swift

    open var second: Int { get }
  • 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.