const EPSILON = 1e-06;
const OFFSET_DISTANT_FUTURE = 1e+100;
const OFFSET_DISTANT_PAST = -OFFSET_DISTANT_FUTURE;
const SECONDS_PER_DAY = 86400.0;
const ABSOLUTE_REFDATE = 730486;
static public double relative_offset;
load, ensuring a high accuracy of dates near the moment in time during which this program is running.
static public Date distant_future;
static public Date distant_past;
double (now) relativeTimeIntervalSinceNow post now > 0.0;
relative_offsetit is now.
(int, double) absoluteAndSecondsOfTimeInterval double ti;
int absoluteFromGregorian (int, int, int) (year, month, day);
(year, month, day). The Gregorian date Sunday, December 31, 1 BC is imaginary.
int absoluteFromIso (int, int, int) (year, week, day);
(year, week, day)in which
weekis in the range 1..52 and
dayis in the range 0..6 (1 == Monday, 2 == Tuesday, ..., 0 == Sunday). The Gregorian date Sunday, December 31, 1 BC is imaginary.
int dayNameOnOrBefore (int, int) (day_name, absolute);
day_nameon or before
day_name==0 means Sunday,
day_name==1 means Monday, and so on.
Note: Applying this function to
absolute+6 gives us the
on or after an absolute day d. Similarly, applying it to
day_name nearest to
absolute, applying it to
absolute-1 gives the
day_name previous to
absolute, and applying
absolute+7 gives the
int dayNumber (int, int, int) (year, month, day);
(year, month, day). For example, dayNumber (1, 1, 1987) returns the value 1, while dayNumber (12, 31, 1980) returns 366.
int dayOfWeekOfAbsolute int absolute;
absolutewhere 0==Sunday, 1==Monday, ..., 6==Saturday.
(int, int, int) gregorianFromAbsolute int date;
boolean isLeapYear int year;
TRUEiff year is a Gregorian leap year.
(int, int, int) isoFromAbsolute int absolute;
absolute. The ISO year corresponds approximately to the Gregorian year, but weeks start on Monday and end on Sunday. The first week of the ISO year is the first such week in which at least 4 days are in a year. The ISO commercial date has the form (year week day) in which week is in the range 1..52 and day is in the range 0..6 (1 = Monday, 2 = Tuesday, ..., 0 = Sunday). The absolute date is the number of days elapsed since the (imaginary) Gregorian date Sunday, December 31, 1 BC.
int lastDayOfMonth int month year int year;
monthof the year
void load MutableArray arguments;
protected double relativeTimeIntervalOfAbsoluteAndSeconds (int, double) (absolute, seconds);
double timeIntervalOfAbsoluteAndSeconds (int, double) (absolute, seconds);
int compare id other;
other0 if the difference is smaller that
EPSILONand 1 if the receiver is after
id dateWithOffset double ti;
tiseconds after the receiver.
Date earlierDate Date other;
otherif it is earlier than the receiver, return the receiver otherwise.
boolean equals id d;
TRUEiff the receiver is within
protected id init double d;
id initWithTimeIntervalSinceNow double ti;
tiseconds after the current time.
id initWithTimeIntervalSinceReferenceDate double ti;
tiseconds after the absolute reference date January 1, 2001.
Date laterDate Date other;
otheriff it is later than the receiver, return the receiver otherwise.
protected double relativeTimeInterval;
double timeIntervalSinceDate Date d;
d. This number is negative if the receiver is earlier than
OutputStream write OutputStream s;
void encodeUsingCoder Encoder coder;
void initWithCoder Decoder coder;