We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent cc4ba6b commit a004215Copy full SHA for a004215
Apple/Foundation.md
@@ -128,6 +128,22 @@ For example:
128
NotificationCenter.default.post(name: someValue, object: nil)
129
```
130
131
+## Use date
132
+
133
+```
134
+Date
135
136
137
+For example:
138
139
+```swift
140
+// The current date and time
141
+Date()
142
143
+// Add seconds
144
+someDate.addingTimeInterval(60)
145
146
147
## Use date formatter
148
149
@@ -145,5 +161,5 @@ dateFormatter.timeZone = TimeZone(abbreviation: "UTC")
161
dateFormatter.date(from: "2000-01-01")
162
163
// Date to string
-dateFormatter.string(from: Date())
164
+dateFormatter.string(from: someDate)
165
0 commit comments