public class NSDate extends NSObject implements NSSecureCoding
Modifier and Type | Method and Description |
---|---|
static NSDate |
date()
Constructs and returns a new date object for the current date and time.
|
static NSDate |
dateWithTimeInterval(double seconds,
NSDate referenceDate)
Constructs and returns a date object spaced from the specified date,
interval that corresponds to the given seconds.
|
static NSDate |
dateWithTimeIntervalSince1970(double seconds)
Constructs and returns a date object spaced from 00:00:00 UTC on 1
January 1970, interval that corresponds to the given seconds.
|
static NSDate |
dateWithTimeIntervalSinceNow(double seconds)
Constructs and returns a date object spaced from the current date,
interval that corresponds to the given seconds.
|
static NSDate |
dateWithTimeIntervalSinceReferenceDate(double seconds)
Constructs and returns a date object spaced from 00:00:00 UTC on 1
January 2001, interval that corresponds to the given seconds.
|
boolean |
equals(Object o) |
int |
hashCode() |
double |
timeIntervalSince1970()
Returns the interval between 00:00:00 UTC on 1 January 1970 and this
date.
|
double |
timeIntervalSinceReferenceDate()
Returns the interval between 00:00:00 UTC on 1 January 2001 and this
date.
|
String |
toString() |
addObserver, observeValueForKeyPath, performSelector, performSelectorOnMainThread, release, removeObserver, removeObserver, retain, setValueForKey, setValueForUndefinedKey, valueForKey, valueForUndefinedKey
supportsSecureCoding
public static NSDate date()
public static NSDate dateWithTimeIntervalSince1970(double seconds)
seconds
- The seconds that specify the new NSDate object.public static NSDate dateWithTimeIntervalSinceReferenceDate(double seconds)
seconds
- The seconds that specify the new NSDate object.public static NSDate dateWithTimeIntervalSinceNow(double seconds)
seconds
- The seconds that specify the new NSDate object.public static NSDate dateWithTimeInterval(double seconds, NSDate referenceDate)
seconds
- The seconds that specify the new NSDate object.referenceDate
- The reference date.public double timeIntervalSinceReferenceDate()
public double timeIntervalSince1970()
Copyright © 2020. All rights reserved.