ObjFW
Public Member Functions | Static Public Member Functions | Protected Attributes
OFDate Class Reference

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

#include <OFDate.h>

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

List of all members.

Public Member Functions

id initWithTimeIntervalSince1970: (int64_t sec)
id initWithTimeIntervalSince1970:microseconds: (int64_t sec,[microseconds] uint32_t usec)
id initWithTimeIntervalSinceNow: (int64_t sec)
id initWithTimeIntervalSinceNow:microseconds: (int64_t sec,[microseconds] uint32_t usec)
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 ()
OFStringdateStringWithFormat: (OFString *fmt)
OFStringlocalDateStringWithFormat: (OFString *fmt)
OFDateearlierDate: (OFDate *date)
OFDatelaterDate: (OFDate *date)
int64_t timeIntervalSince1970 ()
uint32_t microsecondsOfTimeIntervalSince1970 ()
int64_t timeIntervalSinceDate: (OFDate *date)
uint32_t microsecondsOfTimeIntervalSinceDate: (OFDate *date)
OFDatedateByAddingTimeInterval: (int64_t sec)
OFDatedateByAddingTimeInterval:withMicroseconds: (int64_t sec,[withMicroseconds] uint32_t usec)

Static Public Member Functions

id date ()
id dateWithTimeIntervalSince1970: (int64_t sec)
id dateWithTimeIntervalSince1970:microseconds: (int64_t sec,[microseconds] uint32_t usec)
id dateWithTimeIntervalSinceNow: (int64_t sec)
id dateWithTimeIntervalSinceNow:microseconds: (int64_t sec,[microseconds] uint32_t usec)
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 OFDate::date ( ) [static, virtual]
Returns:
A new, autoreleased OFDate with the current date and time
OFDate * OFDate::dateByAddingTimeInterval: ( int64_t  sec) [virtual]

Returns a new date with the specified time interval added.

Parameters:
secThe seconds after the date
Returns:
A new, autoreleased OFDate
OFDate * OFDate::dateByAddingTimeInterval:withMicroseconds: ( int64_t  sec,
[withMicroseconds] uint32_t  usec 
) [virtual]

Returns a new date with the specified time interval added.

Parameters:
secThe seconds after the date
usecThe microseconds after the date
Returns:
A new, autoreleased OFDate
OFString * OFDate::dateStringWithFormat: ( OFString fmt) [virtual]

Creates a string of the date with the specified format.

See the manpage for strftime for information on the format.

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

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

Returns:
A date in the distant future
id OFDate::distantPast ( ) [static, virtual]

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

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

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

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

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

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

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

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

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

Parameters:
secThe seconds since now
usecThe microsecond part of the time
Returns:
A new, autoreleased OFDate with the specified date and time
OFDate * OFDate::laterDate: ( OFDate date) [virtual]
Parameters:
dateAnother date
Returns:
The later date of the two dates
OFString * OFDate::localDateStringWithFormat: ( OFString fmt) [virtual]

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

See the manpage for strftime for information on the format.

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

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