Public Member Functions | Static Public Member Functions | Protected Attributes

OFDate Class Reference

A class for storing, accessing and comparing dates. More...

#import <OFDate.h>

Inheritance diagram for OFDate:
OFObject <OFCopying> <OFComparing> <OFObject>

List of all members.

Public Member Functions

(id) - initWithTimeIntervalSince1970:
(id) - initWithTimeIntervalSince1970:microseconds:
(id) - initWithTimeIntervalSinceNow:
(id) - initWithTimeIntervalSinceNow:microseconds:
(uint32_t) - microsecond
(uint8_t) - second
(uint8_t) - minute
(uint8_t) - hour
(uint8_t) - localHour
(uint8_t) - dayOfMonth
(uint8_t) - localDayOfMonth
(uint8_t) - monthOfYear
(uint8_t) - localMonthOfYear
(uint16_t) - year
(uint8_t) - dayOfWeek
(uint8_t) - localDayOfWeek
(uint16_t) - dayOfYear
(uint16_t) - localDayOfYear
(OFString *) - dateStringWithFormat:
(OFString *) - localDateStringWithFormat:
(OFDate *) - earlierDate:
(OFDate *) - laterDate:
(int64_t) - timeIntervalSince1970
(uint32_t) - microsecondsOfTimeIntervalSince1970
(int64_t) - timeIntervalSinceDate:
(uint32_t) - microsecondsOfTimeIntervalSinceDate:
(OFDate *) - dateByAddingTimeInterval:
(OFDate *) - dateByAddingTimeInterval:withMicroseconds:

Static Public Member Functions

(id) + date
(id) + dateWithTimeIntervalSince1970:
(id) + dateWithTimeIntervalSince1970:microseconds:
(id) + dateWithTimeIntervalSinceNow:
(id) + dateWithTimeIntervalSinceNow:microseconds:
(id) + distantFuture
(id) + distantPast

Protected Attributes

int64_t sec
uint32_t usec

Detailed Description

A class for storing, accessing and comparing dates.


Member Function Documentation

+ (id) date  
Returns:
A new, autoreleased OFDate with the current date and time
- (OFDate *) dateByAddingTimeInterval: (int64_t)  sec  

Returns a new date with the specified time interval added.

Parameters:
sec The seconds after the date
Returns:
A new, autoreleased OFDate
- (OFDate *) dateByAddingTimeInterval: (int64_t)  sec
withMicroseconds: (uint32_t)  usec 

Returns a new date with the specified time interval added.

Parameters:
sec The seconds after the date
usec The microseconds after the date
Returns:
A new, autoreleased OFDate
- (OFString *) dateStringWithFormat: (OFString*)  fmt  

Creates a string of the date with the specified format.

See the manpage for strftime for information on the format.

Parameters:
fmt The format for the date string
Returns:
A new, autoreleased OFString
+ (id) dateWithTimeIntervalSince1970: (int64_t)  sec  
Parameters:
sec The seconds since 1970-01-01T00:00:00Z
Returns:
A new, autoreleased OFDate with the specified date and time
+ (id) dateWithTimeIntervalSince1970: (int64_t)  sec
microseconds: (uint32_t)  usec 
Parameters:
sec The seconds since 1970-01-01T00:00:00Z
usec The microsecond part of the time
Returns:
A new, autoreleased OFDate with the specified date and time
+ (id) dateWithTimeIntervalSinceNow: (int64_t)  sec  
Parameters:
sec The seconds since now
Returns:
A new, autoreleased OFDate with the specified date and time
+ (id) dateWithTimeIntervalSinceNow: (int64_t)  sec
microseconds: (uint32_t)  usec 
Parameters:
sec The seconds since now
usec The microsecond part of the time
Returns:
A new, autoreleased OFDate with the specified date and time
- (uint8_t) dayOfMonth  
Returns:
The day of the month of the date
- (uint8_t) dayOfWeek  
Returns:
The day of the week of the date
- (uint16_t) dayOfYear  
Returns:
The day of the year of the date
+ (id) distantFuture  

Returns a date in the distant future. The date is system-dependant.

Returns:
A date in the distant future
+ (id) distantPast  

Returns a date in the distant past. The date is system-dependant.

Returns:
A date in the distant past
- (OFDate *) earlierDate: (OFDate*)  date  
Parameters:
date Another date
Returns:
The earlier date of the two dates
- (uint8_t) hour  
Returns:
The hour of the date
- (id) initWithTimeIntervalSince1970: (int64_t)  sec  

Initializes an already allocated OFDate with the specified date and time.

Parameters:
sec The seconds since 1970-01-01T00:00:00Z
Returns:
An initialized OFDate with the specified date and time
- (id) initWithTimeIntervalSince1970: (int64_t)  sec
microseconds: (uint32_t)  usec 

Initializes an already allocated OFDate with the specified date and time.

Parameters:
sec The seconds since 1970-01-01T00:00:00Z
usec The microsecond part of the time
Returns:
An initialized OFDate with the specified date and time
- (id) initWithTimeIntervalSinceNow: (int64_t)  sec  

Initializes an already allocated OFDate with the specified date and time.

Parameters:
sec The seconds since now
usec The microsecond part of the time
Returns:
A new, autoreleased OFDate with the specified date and time
- (id) initWithTimeIntervalSinceNow: (int64_t)  sec
microseconds: (uint32_t)  usec 

Initializes an already allocated OFDate with the specified date and time.

Parameters:
sec The seconds since now
usec The microsecond part of the time
Returns:
A new, autoreleased OFDate with the specified date and time
- (OFDate *) laterDate: (OFDate*)  date  
Parameters:
date Another date
Returns:
The later date of the two dates
- (OFString *) localDateStringWithFormat: (OFString*)  fmt  

Creates a string of the local date with the specified format.

See the manpage for strftime for information on the format.

Parameters:
fmt The format for the date string
Returns:
A new, autoreleased OFString
- (uint8_t) localDayOfMonth  
Returns:
The day of the month of the date in local time
- (uint8_t) localDayOfWeek  
Returns:
The day of the week of the date in local time
- (uint16_t) localDayOfYear  
Returns:
The day of the year of the date in local time
- (uint8_t) localHour  
Returns:
The hour of the date in local time
- (uint8_t) localMonthOfYear  
Returns:
The month of the year of the date in local time
- (uint32_t) microsecond  
Returns:
The microsecond of the date
- (uint32_t) microsecondsOfTimeIntervalSince1970  
Returns:
The microseconds part of the seconds since 1970-01-01T00:00:00Z
- (uint32_t) microsecondsOfTimeIntervalSinceDate: (OFDate*)  date  
Returns:
The microseconds part of the seconds the receiver is after the date
- (uint8_t) minute  
Returns:
The minute of the date
- (uint8_t) monthOfYear  
Returns:
The month of the year of the date
- (uint8_t) second  
Returns:
The seconds of the date
- (int64_t) timeIntervalSince1970  
Returns:
The seconds since 1970-01-01T00:00:00Z
- (int64_t) timeIntervalSinceDate: (OFDate*)  date  
Returns:
The seconds the receiver is after the date.
- (uint16_t) year  
Returns:
The year of the date

The documentation for this class was generated from the following files:
 All Classes Functions Variables