291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
|
- (instancetype)initWithTimeIntervalSince1970: (OFTimeInterval)seconds
{
#if defined(OF_OBJFW_RUNTIME) && UINTPTR_MAX == UINT64_MAX
uint64_t value;
#endif
if (seconds == 0) {
static of_once_t once = OF_ONCE_INIT;
of_once(&once, initZeroDate);
return (id)zeroDate;
}
#if defined(OF_OBJFW_RUNTIME) && UINTPTR_MAX == UINT64_MAX
value = OF_BSWAP64_IF_LE(OF_DOUBLE_TO_INT_RAW(OF_BSWAP_DOUBLE_IF_LE(
seconds)));
|
|
|
|
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
|
- (instancetype)initWithTimeIntervalSince1970: (OFTimeInterval)seconds
{
#if defined(OF_OBJFW_RUNTIME) && UINTPTR_MAX == UINT64_MAX
uint64_t value;
#endif
if (seconds == 0) {
static OFOnceControl once = OFOnceControlInitValue;
OFOnce(&once, initZeroDate);
return (id)zeroDate;
}
#if defined(OF_OBJFW_RUNTIME) && UINTPTR_MAX == UINT64_MAX
value = OF_BSWAP64_IF_LE(OF_DOUBLE_TO_INT_RAW(OF_BSWAP_DOUBLE_IF_LE(
seconds)));
|
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
|
{
return [[[self alloc] initWithLocalDateString: string
format: format] autorelease];
}
+ (instancetype)distantFuture
{
static of_once_t once = OF_ONCE_INIT;
of_once(&once, initDistantFuture);
return distantFuture;
}
+ (instancetype)distantPast
{
static of_once_t once = OF_ONCE_INIT;
of_once(&once, initDistantPast);
return distantPast;
}
- (instancetype)init
{
return [self initWithTimeIntervalSince1970: now()];
}
|
|
|
|
|
|
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
|
{
return [[[self alloc] initWithLocalDateString: string
format: format] autorelease];
}
+ (instancetype)distantFuture
{
static OFOnceControl once = OFOnceControlInitValue;
OFOnce(&once, initDistantFuture);
return distantFuture;
}
+ (instancetype)distantPast
{
static OFOnceControl once = OFOnceControlInitValue;
OFOnce(&once, initDistantPast);
return distantPast;
}
- (instancetype)init
{
return [self initWithTimeIntervalSince1970: now()];
}
|