@@ -34,49 +34,18 @@ public struct Date: Equatable, Hashable {
3434 public var timeIntervalSinceReferenceDate : TimeInterval
3535
3636 /// The time interval between the current date and 1 January 1970, GMT.
37- public var timeIntervalsince1970 : TimeInterval {
37+ public var timeIntervalSince1970 : TimeInterval {
3838 get { return timeIntervalSinceReferenceDate + Date. timeIntervalBetween1970AndReferenceDate }
3939 set { timeIntervalSinceReferenceDate = newValue - Date. timeIntervalBetween1970AndReferenceDate }
4040 }
4141
42- /**
43- The time interval between the date and the current date and time.
44-
45- If the date is earlier than the current date and time, the this property’s value is negative.
46-
47- - SeeAlso: `timeIntervalSince(_:)`
48- - SeeAlso: `timeIntervalSince1970`
49- - SeeAlso: `timeIntervalSinceReferenceDate`
50- */
51- public var timeIntervalSinceNow : TimeInterval {
52- return timeIntervalSinceReferenceDate - Date. timeIntervalSinceReferenceDate
53- }
54-
55- /**
56- The interval between the date object and 00:00:00 UTC on 1 January 1970.
57-
58- This property’s value is negative if the date object is earlier than 00:00:00 UTC on 1 January 1970.
59-
60- - SeeAlso: `timeIntervalSince(_:)`
61- - SeeAlso: `timeIntervalSinceNow`
62- - SeeAlso: `timeIntervalSinceReferenceDate`
63- */
64- public var timeIntervalSince1970 : TimeInterval {
65- return timeIntervalSinceReferenceDate + Date. timeIntervalBetween1970AndReferenceDate
66- }
67-
6842 // MARK: - Initialization
6943
7044 /// Returns an `Date` initialized relative to 00:00:00 UTC on 1 January 2001 by a given number of seconds.
7145 public init ( timeIntervalSinceReferenceDate timeInterval: TimeInterval ) {
7246 self . timeIntervalSinceReferenceDate = timeInterval
7347 }
7448
75- /// Returns a `Date` initialized relative to the current date and time by a given number of seconds.
76- public init ( timeIntervalSinceNow: TimeInterval ) {
77- self . timeIntervalSinceReferenceDate = timeIntervalSinceNow + Date. timeIntervalSinceReferenceDate
78- }
79-
8049 /// Returns a `Date` initialized relative to 00:00:00 UTC on 1 January 1970 by a given number of seconds.
8150 public init ( timeIntervalSince1970: TimeInterval ) {
8251 self . timeIntervalSinceReferenceDate = timeIntervalSince1970 - Date. timeIntervalBetween1970AndReferenceDate
@@ -126,12 +95,13 @@ public struct Date: Equatable, Hashable {
12695 }
12796}
12897
98+ #if !arch(wasm32)
99+
129100// MARK: - CustomStringConvertible
130101
131102extension SwiftFoundation . Date : CustomStringConvertible {
132103
133104 public var description : String {
134- // TODO: Custom date printing
135105 return timeIntervalSinceReferenceDate. description
136106 }
137107}
@@ -145,6 +115,8 @@ extension SwiftFoundation.Date: CustomDebugStringConvertible {
145115 }
146116}
147117
118+ #endif
119+
148120// MARK: - Comparable
149121
150122extension SwiftFoundation . Date : Comparable {
0 commit comments