Skip to content

Commit c0e1381

Browse files
authored
Add Date.now static property (#4609)
* Add Date.now static property * Simplify Date.now
1 parent ef9c227 commit c0e1381

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Sources/Foundation/Date.swift

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,9 @@ public struct Date : ReferenceConvertible, Comparable, Equatable {
2727
return CFAbsoluteTimeGetCurrent()
2828
}
2929

30+
/// Returns a `Date` initialized to the current date and time.
31+
public static var now: Date { Date() }
32+
3033
/// Returns a `Date` initialized to the current date and time.
3134
public init() {
3235
_time = CFAbsoluteTimeGetCurrent()

0 commit comments

Comments
 (0)