Returns a date object initialized relative to 00:00:00 UTC on 1 January 1970 by a given number of seconds.
SDKs
- iOS 4.0+
- macOS 10.6+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
convenience init(timeIntervalSince1970 secs: Time Interval)
Parameters
seconds
The number of seconds from the reference date (00:00:00 UTC on 1 January 1970) for the new date. Use a negative argument to specify a date and time before the reference date.
Return Value
An NSDate
object set to seconds
seconds from the reference date.
Discussion
This method is useful for creating NSDate
objects from time_t values returned by BSD system functions.