You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 15, 2024. It is now read-only.
/// Return a new `Date` by adding a `TimeInterval` to this `Date`.
113
+
///
114
+
/// - parameter timeInterval: The value to add, in seconds.
115
+
/// - warning: This only adjusts an absolute value. If you wish to add calendrical concepts like hours, days, months then you must use a `Calendar`. That will take into account complexities like daylight saving time, months with different numbers of days, and more.
/// - parameter timeInterval: The value to add, in seconds.
123
+
/// - warning: This only adjusts an absolute value. If you wish to add calendrical concepts like hours, days, months then you must use a `Calendar`. That will take into account complexities like daylight saving time, months with different numbers of days, and more.
/// - warning: This only adjusts an absolute value. If you wish to add calendrical concepts like hours, days, months then you must use a `Calendar`. That will take into account complexities like daylight saving time, months with different numbers of days, and more.
178
+
staticfunc+=(lhs:inoutDate, rhs:TimeInterval){
179
+
lhs = lhs + rhs
180
+
}
181
+
182
+
/// Subtract a `TimeInterval` from a `Date`.
183
+
///
184
+
/// - warning: This only adjusts an absolute value. If you wish to add calendrical concepts like hours, days, months then you must use a `Calendar`. That will take into account complexities like daylight saving time, months with different numbers of days, and more.
/// Returns the `TimeInterval` between this `Date` and another given date.
192
+
///
193
+
/// - returns: The interval between the receiver and the another parameter. If the receiver is earlier than `other`, the return value is negative.
194
+
func distance(to other:Date)->TimeInterval{
195
+
return other.timeIntervalSince(self)
196
+
}
197
+
198
+
/// Creates a new date value by adding a `TimeInterval` to this `Date`.
199
+
///
200
+
/// - warning: This only adjusts an absolute value. If you wish to add calendrical concepts like hours, days, months then you must use a `Calendar`. That will take into account complexities like daylight saving time, months with different numbers of days, and more.
0 commit comments