GlobalDateTime
open class GlobalDateTime : DataValue, @unchecked Sendable
Represents the XML Schema dateTime type with zone offset.
-
Time zone constant for GMT.
Declaration
Swift
public static let GMT: TimeZone -
Declaration
Swift
public func utc() -> DateReturn Value
This global date/time value converted to UTC-based point in time.
-
Declaration
Swift
public static func from(utc dateTime: Date, in timeZone: TimeZone = GMT) -> GlobalDateTimeParameters
utcUTC-based point in time.
timeZoneTime zone in which the global date/time will be determined (defaults to GMT). Use
TimeZone.currentfor the local time zone.Return Value
Global date/time equivalent of UTC-based point in time.
-
Compare two dateTime values.
Declaration
Swift
open class func compare(_ left: GlobalDateTime, _ right: GlobalDateTime) -> IntParameters
leftThe first dateTime for comparison.
rightThe second dateTime for comparison.
Return Value
-1 if
left < right, 0 ifleft == right, or 1 ifleft > right. -
Compare this dateTime with another dateTime.
Declaration
Swift
open func compareTo(_ value: GlobalDateTime) -> IntParameters
valueThe other dateTime value.
Return Value
-1 if this dateTime is less than the value dateTime, 0 if they are equal, 1 if this dateTime is greater than the value dateTime.
-
Declaration
Swift
override open func copyMutable() -> DataValueReturn Value
A clone of this value if it (together with all value subcomponents) is possibly mutable, or return
selfvalue 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 } -
Local date component of dateTime.
Declaration
Swift
open var date: LocalDate { get } -
Day field of date (1 to 31).
Declaration
Swift
open var day: Int { get } -
Day of week (1 to 7).
See also
DayOfWeek.Declaration
Swift
open var dayOfWeek: Int { get } -
Day of year (1 to 366).
Declaration
Swift
open var dayOfYear: Int { get } -
Compare two dateTime values.
Declaration
Swift
open class func equal(_ left: GlobalDateTime?, _ right: GlobalDateTime?) -> BoolParameters
leftThe first dateTime for comparison.
rightThe second dateTime for comparison.
Return Value
trueifleftis equal toright, otherwisefalse. -
Compare this dateTime value with another dateTime value.
Declaration
Swift
override open func equals(_ other: AnyObject?) -> BoolParameters
otherThe other dateTime value.
Return Value
True, if this dateTime value is equal to the value dateTime value. Otherwise
false. -
Compare this dateTime value with another dateTime value.
Declaration
Swift
open func greaterEqual(_ value: GlobalDateTime) -> BoolParameters
valueThe other dateTime value.
Return Value
trueif this dateTime value is greater than or equal to the value dateTime value. Oherwisefalse. -
Compare two dateTime values.
Declaration
Swift
open class func greaterEqual(_ left: GlobalDateTime, _ right: GlobalDateTime) -> BoolParameters
leftThe first dateTime for comparison.
rightThe second dateTime for comparison.
Return Value
trueifleftis greater than or equal toright, otherwisefalse. -
Compare this dateTime value with another dateTime value.
Declaration
Swift
open func greaterThan(_ value: GlobalDateTime) -> BoolParameters
valueThe other dateTime value.
Return Value
trueif this dateTime value is greater than the value dateTime value. Oherwisefalse. -
Compare two dateTime values.
Declaration
Swift
open class func greaterThan(_ left: GlobalDateTime, _ right: GlobalDateTime) -> BoolParameters
leftThe first dateTime for comparison.
rightThe second dateTime for comparison.
Return Value
trueifleftis greater thanright, otherwisefalse. -
Hash this data value to a number.
Declaration
Swift
override open func hashCode() -> IntReturn 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 dateTime value with another dateTime value.
Declaration
Swift
open func lessEqual(_ value: GlobalDateTime) -> BoolParameters
valueThe other dateTime value.
Return Value
trueif this dateTime value is less than or equal to the value dateTime value. Oherwisefalse. -
Compare two dateTime values.
Declaration
Swift
open class func lessEqual(_ left: GlobalDateTime, _ right: GlobalDateTime) -> BoolParameters
leftThe first dateTime for comparison.
rightThe second dateTime for comparison.
Return Value
trueifleftis less than or equal toright, otherwisefalse. -
Compare this dateTime value with another dateTime value.
Declaration
Swift
open func lessThan(_ value: GlobalDateTime) -> BoolParameters
valueThe other dateTime value.
Return Value
trueif this dateTime value is less than the value dateTime value. Oherwisefalse. -
Compare two dateTime values.
Declaration
Swift
open class func lessThan(_ left: GlobalDateTime, _ right: GlobalDateTime) -> BoolParameters
leftThe first dateTime for comparison.
rightThe second dateTime for comparison.
Return Value
trueifleftis less thanright, otherwisefalse. -
Declaration
Swift
open class func literal(_ text: String) -> GlobalDateTimeParameters
textValue in XML Schema format.
Return Value
Value parsed from XML Schema format (with zone offset), or panic if
texthas invalid dateTime format. Useparseif thetextis not guaranteed to be in the correct format. -
Declaration
Swift
open class func millisBetween(a: GlobalDateTime, b: GlobalDateTime) -> Int64Parameters
aThe first dateTime value.
bThe second dateTime value.
Return Value
The difference in milliseconds between two dateTime values
aandb, calculated asb - a. -
Declaration
Swift
open func minus(_ value: GlobalDateTime) -> DoubleParameters
valueThe other dateTime value.
Return Value
The difference
this - value, measured in days. -
Minute field of time (0 to 59).
Declaration
Swift
open var minute: Int { get } -
Month field of date (1 to 12).
See also
MonthOfYear.Declaration
Swift
open var month: Int { get } -
Nanosecond field of time (0 to 999999999).
Declaration
Swift
open var nano: Int { get } -
Normalize this dateTime value to UTC. For example “2000-01-01T14:00:00+12:00” would normalize to “2000-01-01T02:00:00Z”
Declaration
Swift
open func normalize() -> GlobalDateTimeReturn Value
An equivalent value with all fields normalized (adjusted) to UTC, such that
offsetis zero. -
Compare this dateTime value with another dateTime value.
Declaration
Swift
open func notEqual(_ value: GlobalDateTime) -> BoolParameters
valueThe other dateTime value.
Return Value
trueif this dateTime value is not equal to the value dateTime value. Oherwisefalse. -
Compare two dateTime values.
Declaration
Swift
open class func notEqual(_ left: GlobalDateTime?, _ right: GlobalDateTime?) -> BoolParameters
leftThe first dateTime for comparison.
rightThe second dateTime for comparison.
Return Value
trueifleftis not equal toright, otherwisefalse. -
Declaration
Swift
open class func now() -> GlobalDateTimeReturn Value
The current global dateTime.
-
Declaration
Swift
open class func of(year: Int, month: Int, day: Int, hour: Int, minute: Int, second: Int, nano: Int = (0 as Int)) -> GlobalDateTimeParameters
yearThe year field.
monthThe month field (1 to 12).
dayThe day field (1 to 31).
hourThe hour field (0 to 23).
minuteThe minute field (0 to 59).
secondThe second field (0 to 59).
nanoThe nano field (0 to 999999999).
Return Value
A new dateTime value.
-
Convert a Julian day number to a global date/time.
Declaration
Swift
open class func ofJulian(day: Double) -> GlobalDateTimeParameters
dayJulian day number.
Return Value
Global date/time, with microsecond precision.
-
Time zone offset in minutes (-840 to 840).
Declaration
Swift
open var offset: Int { get } -
Declaration
Swift
open class func parse(_ text: String) -> GlobalDateTime?Parameters
textValue in XML Schema format.
Return Value
Value parsed from XML Schema format (with zone offset), or
niliftexthas invalid dateTime format. -
Declaration
Swift
open func plusDays(_ days: Int) -> GlobalDateTimeParameters
daysNumber of days to add. Can be negative, zero or positive.
Return Value
A new dateTime which is the specified number of days ahead of this dateTime.
-
Declaration
Swift
open func plusHours(_ hours: Int64) -> GlobalDateTimeParameters
hoursNumber of hours to add. Can be negative, zero or positive.
Return Value
A new dateTime which is the specified number of hours ahead of this dateTime.
-
Declaration
Swift
open func plusMicros(_ micros: Int64) -> GlobalDateTimeParameters
microsNumber of microseconds to add. Can be negative, zero or positive.
Return Value
A new dateTime which is the specified number of microseconds ahead of this dateTime.
-
Declaration
Swift
open func plusMillis(_ millis: Int64) -> GlobalDateTimeParameters
millisNumber of milliseconds to add. Can be negative, zero or positive.
Return Value
A new dateTime which is the specified number of milliseconds ahead of this dateTime.
-
Declaration
Swift
open func plusMinutes(_ minutes: Int64) -> GlobalDateTimeParameters
minutesNumber of minutes to add. Can be negative, zero or positive.
Return Value
A new dateTime which is the specified number of minutes ahead of this dateTime.
-
Declaration
Swift
open func plusMonths(_ months: Int) -> GlobalDateTimeParameters
monthsNumber of months to add. Can be negative, zero or positive.
Return Value
A new dateTime/time which is the specified number of months ahead of this dateTime.
-
Declaration
Swift
open func plusNanos(_ nanos: Int64) -> GlobalDateTimeParameters
nanosNumber of nanoseconds to add. Can be negative, zero or positive.
Return Value
A new dateTime which is the specified number of nanoseconds ahead of this dateTime.
-
Declaration
Swift
open func plusSeconds(_ seconds: Int64) -> GlobalDateTimeParameters
secondsNumber of seconds to add. Can be negative, zero or positive.
Return Value
A new dateTime which is the specified number of seconds ahead of this dateTime.
-
Declaration
Swift
open func plusWeeks(_ weeks: Int) -> GlobalDateTimeParameters
weeksNumber of weeks to add. Can be negative, zero or positive.
Return Value
A new dateTime which is the specified number of weeks ahead of this dateTime.
-
Declaration
Swift
open func plusYears(_ years: Int) -> GlobalDateTimeParameters
yearsNumber of years to add. Can be negative, zero or positive.
Return Value
A new dateTime which is the specified number of years ahead of this dateTime.
-
Second field of time (0 to 59).
Declaration
Swift
open var second: Int { get } -
Local time component of dateTime.
Declaration
Swift
open var time: LocalTime { get } -
Convert a global date/time to a Julian day number.
Declaration
Swift
open class func toJulian(dt: GlobalDateTime) -> DoubleParameters
dtGlobal date/time.
Return Value
Julian day number, with microsecond precision.
-
See also
normalize.Declaration
Swift
open func toLocal() -> LocalDateTimeReturn Value
This local date and time portion of this value, without zone offset.
-
Convert this data value to a string. If the
dataTypeis 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() -> StringReturn Value
Lexical representation of this data value.
-
Year field of date.
Declaration
Swift
open var year: Int { get } -
Declaration
Swift
open func zone(offset: Int) -> GlobalDateTimeParameters
offsetZone offset in minutes (-840 to 840).
Return Value
A dateTime value with all fields the same as the current dateTime value except for the zone offset.