richard@brainstorm.co.uk
)Version: 1.10
Date: 2004/09/14 03:34:37
Copyright: (C) 1998 Free Software Foundation, Inc.
- Declared in:
- Foundation/NSDateFormatter.h
- Conforms to:
- NSCoding
- NSCopying
Standards:
- MacOS-X
- NotOpenStep
- GNUstep
Class for generating text representations of NSDate s and NSCalendarDate s, and for converting strings into instances of these objects. Note that NSDate and NSCalendarDate do contain some string conversion methods, but using this class provides more control over conversion.
See the NSFormatter documentation for description of the basic methods for formatting and parsing that are available.
The basic format of a format string uses "%" codes to represent components of the date. Thus, for example, @"%b %d, %Y"
specifies strings similar to "June 18, 1991". The full list of codes is as follows:
Returns whether initialized to support natural
language formatting. If YES
,
string-to-object conversion will attempt
to process strings as natural language dates, such as
"yesterday", or "first Tuesday of next month"
if straight format-based conversion fails.
Returns format string initialized with, specifying
how dates are formatted, for object-to-string
conversion, and how they are parsed, for
string-to-object conversion. For example,
@"%b %d, %Y"
specifies strings similar
to "June 18, 1991".
Initialize with given specifier string
format. See class description for how to
specify a format string. If
flag is YES
, string-to-object
conversion will attempt to process strings as
natural language dates, such as "yesterday", or
"first Tuesday of next month" if straight
format-based conversion fails.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.
Warning the underscore at the start of the name of this instance variable indicates that, even though it is not technically private, it is intended for internal use within the package, and you should not use the variable in other code.