home *** CD-ROM | disk | FTP | other *** search
/ Altsys Virtuoso 2.0K / virtuoso_20k.iso / NeXTanswers / OpenStepSpec_rtf / FoundationKit / Classes / NSDate.rtf < prev    next >
Encoding:
Text File  |  1994-07-01  |  9.0 KB  |  110 lines

  1. {\rtf0\ansi\paperw16228 \paperh18648 \margl-907 \margr0 \margt0 \margb0 {\fonttbl\f0\fswiss Helvetica;\f1\froman Times;\f2\fmodern Courier;\f3\ftech Symbol;\f4\froman Palatino;}
  2. {\stylesheet{\s0 \li100 \fi0 \ri1007 \ql   1Head;}
  3. {\s1 \li100 \fi0 \ri1007 \ql   ClassName;}
  4. {\s2 \li2872 \fi-2771 \ri1007 \ql \tx2872   ConformsTo;}
  5. {\s3 \li2872 \fi-2771 \ri1007 \ql   DeclaredIn;}
  6. {\s4 \li7029 \fi-6552 \ri1007 \ql \tx6652 \tx7030   Description;}
  7. {\s5 \li7030 \fi-5796 \ri1007 \ql   DescriptionPart;}
  8. {\s6 \li0 \fi0 \ri0 \ql \tx-25 \tx8290 \tx9172   Footer;}
  9. {\s7 \li2872 \fi-2771 \ri1007 \ql \tx2872   InheritsFrom;}
  10. {\s8 \li100 \fi0 \ri1007 \ql   Summary;}
  11. }
  12. \li0 \fi0 \ri0 \ql \sb0 \f1 \fs24 
  13. (Preliminary Documentation) Copyright \f3 \'e3\f1 1994 by NeXT Computer, Inc.  All Rights Reserved.\
  14. \
  15. \s0 \li100 \fi0 \ri1007 \ql \f0 \b \fs36 \fs16 \
  16. \
  17. \
  18. \
  19. \
  20. \
  21. \
  22. \fs36 NSDate \
  23. \pard \s7 \li2872 \fi-2771 \ri1007 \ql \tx2872 \f1 \b0 \fs28 \fs16 \
  24. \
  25. \
  26. \fs28 \f0 \b \fs28 Inherits From:    \b0 \fs28 \f1 NSObject \
  27. \fs16 \
  28. \fs28 \s2 \fs16 \fs28 \f0 \b \fs28 Conforms To:    \b0 \fs28 \f1 NSCopying\
  29. \fi0 NSObject \
  30. \fs16 \
  31. \fs28 \s3 \fi-2771 \fs16 \fs28 \f0 \b \fs28 Declared In:    \b0 \fs28 \f1 foundation/NSDate.h \
  32. \fs16 \
  33. \fs28 \pard \s8 \li100 \fi0 \ri1007 \ql \f0 \b \fs28 \fs16 \
  34. \
  35. \fs28 Allocating and Initializing a Date Object \
  36. \fs16 \
  37. \fs28 \pard \s4 \li7029 \fi-6552 \ri1007 \ql \tx6652 \tx7030 \f1 \b0 \fi-6552 + (id)\b allocWithZone:\b0 (NSZone *)\i zone\i0     Allocates an unitialized date object in \i zone\i0 .  Returns \b nil\b0  if allocation fails.\
  38. \fi-6552 \fi-6552 \fi-6552 + (NSDate *)\b date\b0     Creates and returns a date object set to the current date and time.\
  39. \fi-6552 \fi-6552 \fi-6552 + (NSDate *)\b dateWithTimeIntervalSinceNow:\b0 (NSTimeInterval)\i seconds\
  40. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796 \i0     Creates and returns a date object set to \i seconds\i0  seconds from the current date and time.\
  41. \s4 \li7029 \fi-5794 \fi-6552 \fi-6552 + (NSDate *)\b dateWithTimeIntervalSince1970:\b0 (NSTimeInterval)\i seconds\
  42. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796 \i0     Creates and returns a date object set to to \i seconds\i0  seconds from the reference date used by UNIX\f3 \fs18 \up6 \'e2\f1 \fs28 \up0 systems. Use a negative argument value to specify a date and time before the reference date.\
  43. \s4 \li7029 \fi-5794 \fi-6552 \fi-6552 + (NSDate *)\b dateWithTimeIntervalSinceReferenceDate:\b0 (NSTimeInterval)\i seconds\
  44. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796 \i0     Creates and returns a date object set to to \i seconds\i0  seconds from the absolute reference date (the first instant of 1 January, 2001). Use a negative argument value to specify a date and time before the reference date.\
  45. \s4 \li7029 \fi-5794 \fi-6552 \fi-6552 + (NSDate *)\b distantFuture\b0     Creates and returns a date object that represents a date in the distant future (in terms of centuries).  You can use this object in your code as a control date, a guaranteed outer temporal limit.\
  46. \fi-6552 \fi-6552 \fi-6552 + (NSDate *)\b distantPast\b0     Creates and returns a date object that represents a date in the distant past (in terms of centuries).  You can use this object in your code as a control date, a guaranteed temporal boundary.\
  47. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (id)\b init\b0     Initializes a newly allocated date object  to the current date and time.\
  48. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (id)\b initWithString:\b0 (NSString *)\i description\i0     Returns a date object with a date and time value specified by the international string-representation format: YYYY-MM-DD HH:MM:SS \f3 {\f3 -}\f1 HHMM, where \f3 {\f3 -}\f1 HHMM is a time zone offset in hours and minutes from Greenwich Mean Time.\
  49. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (NSDate *)\b initWithTimeInterval:\b0 (NSTimeInterval)\i seconds\
  50. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796 \i0 \b sinceDate:\b0 (NSDate *)\i anotherDate\i0     Returns a date object initialized relative to another date object by \i seconds\i0  (plus or minus).\
  51. \s4 \li7029 \fi-5794 \fi-6552 \fi-6552 {\f3 -} (NSDate *)\b initWithTimeIntervalSinceNow:\b0 (NSTimeInterval)\i seconds\
  52. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796 \i0     Returns a date object initialized relative to the current date and time by \i seconds\i0  (plus or minus).\
  53. \s4 \li7029 \fi-5794 \fi-6552 \fi-6552 {\f3 -} (id)\b initWithTimeIntervalSinceReferenceDate:\b0 (NSTimeInterval)\i seconds\
  54. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796 \i0     Returns a date object initialized relative to the reference date and time by \i seconds\i0  (plus or minus).\
  55. \pard \s8 \li100 \fi0 \ri1007 \ql \f0 \b \fs16 \
  56. \
  57. \
  58. \fs28 Converting to an NSCalendar Object\
  59. \fs16 \
  60. \fs28 \pard \s4 \li7029 \fi-6552 \ri1007 \ql \tx6652 \tx7030 \f1 \b0 \fi-6552 {\f3 -} (NSCalendarDate *)\b dateWithCalendarFormat:\b0 (NSString *)\i formatString\
  61. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796 \i0 \b timeZone:\b0 (NSTimeZone *)\i timeZone\i0     Converts the date object to an NSCalendarDate object bound to the format string \i formatString\i0  and the time zone \i timeZone\i0 .  If you specify \b nil\b0  after either or both of these  arguments, the default format string and time zone are assumed.\
  62. \pard \s8 \li100 \fi0 \ri1007 \ql \f0 \b \fs16 \
  63. \
  64. \
  65. \fs28 Representing Dates\
  66. \fs16 \
  67. \fs28 \pard \s4 \li7029 \fi-6552 \ri1007 \ql \tx6652 \tx7030 \f1 \b0 \fi-6552 {\f3 -} (NSString *)\b description\b0     Returns a string representation of the NSDate object that conforms to the international format YYYY-MM-DD HH:MM:SS \f3 {\f3 -}\f1 HHMM, where \f3 {\f3 -}\f1 HHMM represents the time-zone offset in hours and minutes from Greenwich Mean Time (GMT).\
  68. \fi-6552 \fi-6552 \fi-6552 - (NSString *)\b descriptionWithCalendarFormat:\b0 (NSString *)\i formatString\
  69. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796 \i0 \b timeZone\b0 :(NSTimeZone *)\i aTimeZone    \i0 Returns a string representation of the NSDate object that\
  70. \b locale:\b0 (NSDictionary *)\i localeDictionary\i0         conforms to \i formatString\i0  (a \b strftime\b0 -style date-conversion string) and that is adjusted to \i aTimeZone\i0 .  Included are the keys and values that represent the locale data from \i localeDictionary\i0 .\
  71. \s4 \li7029 \fi-5794 \fi-6552 \fi-6552 {\f3 -} (NSString *)\b descriptionWithLocale:\b0 (NSDictionary *)\i localeDictionary\
  72. \fi-6552 \fi-6552 \i0 \fi-6552     Returns a string representation of the NSDate object (see \b description\b0 ).  Included are the key and values that represent the locale data from \i localeDictionary\i0 .\
  73. \fi-6552 \pard \s8 \li100 \fi0 \ri1007 \ql \f0 \b \fs16 \
  74. \
  75. \
  76. \fs28 Adding and Getting Intervals\
  77. \fs16 \
  78. \fs28 \pard \s4 \li7029 \fi-6552 \ri1007 \ql \tx6652 \tx7030 \f1 \b0 \fi-6552 + (NSTimeInterval)\b timeIntervalSinceReferenceDate\b0     \
  79. \fi-6552 \fi-6552 \fi-6552     Returns the interval between the system\'27s absolute reference date and the current date and time.  This value is less than zero until the first instant of 1 January 2001.\
  80. \fi-6552 \fi-6552 \fi-6552 {\f3 -} \b addTimeInterval:\b0 (NSTimeInterval)\i seconds\i0     Returns a date object that\'27s set to a specified number of seconds relative to the receiver.\
  81. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (NSTimeInterval)\b timeIntervalSince1970\b0     Returns the interval between the receiver and the reference date used by UNIX\f3 \fs18 \up6 \'e2\f1 \fs28 \up0 systems.\
  82. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (NSTimeInterval)\b timeIntervalSinceDate:\b0 (NSDate *)\i otherDate\
  83. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796 \i0     Returns the interval between the receiver and \i otherDate\i0 .\
  84. \s4 \li7029 \fi-5794 \fi-6552 \fi-6552 {\f3 -} (NSTimeInterval)\b timeIntervalSinceNow\b0     Returns the interval between the receiver and the current date and time.\
  85. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (NSTimeInterval)\b timeIntervalSinceReferenceDate\b0     \
  86. \fi-6552 \pard \s5 \li7030 \fi-5796 \ri1007 \ql \tx6652 \tx7030     Returns the interval between the receiver and the system\'27s absolute reference date.  This value is less than zero until the first instant of 1 January 2001.\
  87. \pard \s8 \li100 \fi0 \ri1007 \ql \f0 \b \fs16 \
  88. \
  89. \
  90. \fs28 Comparing Dates\
  91. \fs16 \
  92. \fs28 \pard \s4 \li7029 \fi-6552 \ri1007 \ql \tx6652 \tx7030 \f1 \b0 \fi-6552 {\f3 -} (NSComparisonResult)\b compare:\b0 (NSDate *)\i otherDate\
  93. \fi-6552 \s5 \li7030 \fi-6553 \fi-5796 \i0 \fs28     \fs28 Compares the receiving date to \i otherDate\i0  and returns NSOrderedDescending if the receiver is temporally later, NSOrderedAscending if it\'27s temporally earlier, and NSOrderedSame if they are equal.\
  94. \s4 \li7029 \fi-5794 \fi-6552 \fi-6552 {\f3 -} (NSDate *)\b earlierDate:\b0 (NSDate *)\i otherDate\i0     Compares the receiver date to \i otherDate\i0  and returns the one that\'27s temporally earlier.\
  95. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (BOOL)\b isEqual:\b0 (id)\i otherDate\i0     Returns YES if \i otherDate\i0  and the receiver are within one second of each other; otherwise, returns NO.\
  96. \fi-6552 \fi-6552 \fi-6552 {\f3 -} (NSDate *)\b laterDate:\b0 (NSDate *)\i otherDate\i0     Compares the receiver date to \i otherDate\i0  and returns the one that\'27s temporally later.\
  97. \fi-6552 \fi-6552 \fi-6552 \
  98. \fi-6552 \pard \s0 \li100 \fi0 \ri1007 \tx478 \tx856 \tx1234 \fs28 \fs16 \
  99. \
  100. \fs28 \
  101. \fs16 \
  102. \
  103. \fs28 \pard \s0 \
  104. \li100 \fi0 \fs16 \
  105. \
  106. \fs28 \
  107. \fs16 \
  108. \
  109. \fs28 }
  110.