Skip to content

Commit a004215

Browse files
committed
Clarify Foundation dates
1 parent cc4ba6b commit a004215

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

Apple/Foundation.md

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,22 @@ For example:
128128
NotificationCenter.default.post(name: someValue, object: nil)
129129
```
130130

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+
131147
## Use date formatter
132148

133149
```
@@ -145,5 +161,5 @@ dateFormatter.timeZone = TimeZone(abbreviation: "UTC")
145161
dateFormatter.date(from: "2000-01-01")
146162

147163
// Date to string
148-
dateFormatter.string(from: Date())
164+
dateFormatter.string(from: someDate)
149165
```

0 commit comments

Comments
 (0)