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 ifleft == right
, or 1 ifleft > right
. -
Compare this time with another time.
Declaration
Swift
open func compareTo(_ value: LocalTime) -> Int
Parameters
value
The other time value.
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.
-
Declaration
Swift
override open func copyMutable() -> DataValue
Return Value
A clone of this value if it (together with all value subcomponents) is possibly mutable, or return
self
value if it (together with all value subcomponents) is definitely immutable. The resulting value might share mutable metadata with this query. -
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
ifleft
is equal toright
, otherwisefalse
. -
Compare this time value with another time value.
Declaration
Swift
override open func equals(_ other: AnyObject?) -> Bool
Parameters
other
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. Oherwisefalse
. -
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
ifleft
is greater than or equal toright
, otherwisefalse
. -
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. Oherwisefalse
. -
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
ifleft
is greater thanright
, otherwisefalse
. -
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 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. Oherwisefalse
. -
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
ifleft
is less than or equal toright
, otherwisefalse
. -
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. Oherwisefalse
. -
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
ifleft
is less thanright
, otherwisefalse
. -
Declaration
Swift
open class func literal(_ text: String) -> LocalTime
Parameters
text
Value in XML Schema format.
Return Value
Value parsed from XML Schema format, or panic if
text
has invalid time format. Useparse
if thetext
is not guaranteed to be in the correct format. -
Declaration
Swift
open func minus(_ value: LocalTime) -> Double
Parameters
value
The other time value.
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. Oherwisefalse
. -
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
ifleft
is not equal toright
, otherwisefalse
. -
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
iftext
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.