scottc@net-community.com
)rfm@gnu.org
)Version: 1.89
Date: 2003/09/10 07:59:14
Copyright: (C) 1996, 1998, 1999, 2000, 2002 Free Software Foundation, Inc.
- Declared in:
- Foundation/NSCalendarDate.h
Standards:
- MacOS-X
- OpenStep
- GNUstep
An NSDate subclass which understands about timezones and provides methods for dealing with date and time information by calendar and with hours minutes and seconds.
Method summaryReturn an NSCalendarDate for the current date and time using the default timezone.
Return an NSCalendarDate generated from the supplied
description using the format
specified for parsing that string.
Calls
-initWithString:calendarFormat:
to create the date.
Return an NSCalendarDate generated from the supplied
description using the format
specified for parsing that string and
interpreting it according to the
dictionary specified.
Calls
-initWithString:calendarFormat:locale:
to create the date.
Creates and returns an NSCalendarDate from the specified values by calling -initWithYear:month:day:hour:minute:second:timeZone:
This method exists solely for conformance to the OpenStep spec. Its use is deprecated... it simply calls -dateByAddingYears:months:days:hours:minutes:seconds:
Returns the format string associated with the
receiver.
See
-descriptionWithCalendarFormat:locale:
for details.
Return the day number (ie number of days since the start of) in the 'common' era of the receiving date. The era starts at 1 A.D.
Return the month (1 to 31) of the receiving date.
Return the day of the week (0 to 6) of the receiving date.
Return the day of the year (1 to 366) of the receiving date.
Calls
-descriptionWithCalendarFormat:locale:
passing the receviers calendar format and a nil
locale.
Returns a string representation of the receiver
using the specified format string.
Calls
-descriptionWithCalendarFormat:locale:
with a nil
locale.
Returns a string representation of the receiver
using the specified format string and
locale dictionary.
Format
specifiers are -
Returns a description of the receiver using its
normal format but with the specified
locale dictionary.
Calls
-descriptionWithCalendarFormat:locale:
to do this.
Return the hour of the day (0 to 23) of the receiving date.
Initializes an NSCalendarDate using the
specified description and the default
calendar format and locale.
Calls
-initWithString:calendarFormat:locale:
Initializes an NSCalendarDate using the
specified description and
format string interpreted in the default
locale.
Calls
-initWithString:calendarFormat:locale:
Initializes an NSCalendarDate using the
specified description and format
string interpreted in the given locale.
Format specifiers are -
Returns an NSCalendarDate instance with the given
year, month, day,
hour, minute, and
second, using aTimeZone.
The year includes the century (ie you can't
just say '02' when you mean '2002').
The
month is in the range 1 to 12,
The
day is in the range 1 to 31,
The
hour is in the range 0 to 23,
The
minute is in the range 0 to 59,
The
second is in the range 0 to 59.
If
aTimeZone is nil
, the
[NSTimeZone +localTimeZone]
value is used.
GNUstep checks the validity of the method arguments, and unless the base library was built with 'warn=no' it generates a warning for bad values. It tries to use those bad values to generate a date anyway though, rather than failing (this also appears to be the behavior of MacOS-X).
The algorithm GNUstep uses to create the date is this
...
Return the minute of the hour (0 to 59) of the receiving date.
Return the month of the year (1 to 12) of the receiving date.
Return the second of the minute (0 to 59) of the receiving date.
Sets the format string associated with the
receiver.
See
-descriptionWithCalendarFormat:locale:
for details.
Sets the time zone associated with the receiver.
Returns the time zone associated with the receiver.
Returns the time zone detail associated with the receiver.
Return the year of the 'common' era of the receiving date. The era starts at 1 A.D.
- Declared in:
- Foundation/NSCalendarDate.h
Standards:
- NotOpenStep
- NotMacOS-X
- GNUstep
Description forthcoming.
Method summaryDescription forthcoming.
- Declared in:
- Foundation/NSCalendarDate.h
Standards:
- NotOpenStep
- NotMacOS-X
- GNUstep
Routines for manipulating Gregorian dates
Method summaryReturns the number of days since the start of the era for the specified day, month, and year.
Given a day number since the start of the era, returns the date as a day, month, and year.
Returns the number of the last day of the month in the specified year.
- Declared in:
- Foundation/NSCalendarDate.h
Standards:
- OpenStep
- NotMacOS-X
- GNUstep
Methods present in OpenStep but later removed from MacOS-X
Method summary
Returns a calendar date formed by adding the specified offsets to the receiver. The offsets are added in order, years, then months, then days, then hours then minutes then seconds, so if you add 1 month and forty days to 20th September, the result will be 9th November.
This method understands leap years and tries to adjust for daylight savings time changes so that it preserves expected clock time.
Returns the number of years,
months, days, hours,
minutes, and seconds between
the receiver and the given date.
If
date is in the future of the receiver, the
returned values will be negative (or zero),
otherwise they are all positive.
If any of
the pointers to return value in is null, the
corresponding value will not be returned, and
other return values will be adjusted accordingly. eg.
If a difference of 1 hour was to be returned but
hours is null, then the value returned in
minutes will be increased by 60.