mirror of
https://github.com/gnustep/libs-base.git
synced 2025-04-23 00:41:02 +00:00
Implement +[NSDate now]
This commit is contained in:
parent
648f3e2dfb
commit
ca1d07dcf2
2 changed files with 13 additions and 0 deletions
|
@ -163,6 +163,13 @@ GS_EXPORT_CLASS
|
|||
*/
|
||||
+ (instancetype) distantFuture;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_15, GS_API_LATEST)
|
||||
/** Returns an autoreleased instance with the date/time set to
|
||||
* the time of access.
|
||||
*/
|
||||
+ (instancetype) now;
|
||||
#endif
|
||||
|
||||
/** Returns the time interval between the reference date and the current
|
||||
* time.
|
||||
*/
|
||||
|
|
|
@ -164,6 +164,12 @@ otherTime(NSDate* other)
|
|||
initWithTimeIntervalSinceReferenceDate: GSPrivateTimeNow()]);
|
||||
}
|
||||
|
||||
+ (instancetype) now
|
||||
{
|
||||
return AUTORELEASE([[self allocWithZone: NSDefaultMallocZone()]
|
||||
initWithTimeIntervalSinceReferenceDate: GSPrivateTimeNow()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an autoreleased instance representing the date and time given
|
||||
* by string. The value of string may be a 'natural' specification as
|
||||
|
|
Loading…
Reference in a new issue