Declared in NSDate+TKCategory.h

Overview

Additional functionality for NSDate.

Tasks

  • + yesterday

    Creates and returns a new date set to the previous day and current time.

  • + yesterdayWithTimeZone:

    Creates and returns a new date set to the previous day and current time. Things get tricky with respect to day light saving. Simple subtraction of 24 hours (using @code[NSDate dateWithTimeIntervalSinceNow:]@endcode) might not yield the expected results.

  • + tomorrow

    Creates and returns a new date set to tomorrow’s day and current time.

  • + tomorrowWithTimeZone:

    Creates and returns a new date set to the tomorrow’s day and current time. Things get tricky with respect to day light saving. Simple subtraction of 24 hours (using @code[NSDate dateWithTimeIntervalSinceNow:]@endcode) might not yield the expected results.

  • + month

    Creates and returns a new date set to the current month date.

  • + monthWithTimeZone:

    Creates and returns a new date set to the current month date. Things get tricky with respect to day light saving. Simple subtraction of a give time (using @code[NSDate dateWithTimeIntervalSinceNow:]@endcode) might not yield the expected results.

  • – monthDate

    Creates and returns a new date set to the first day of the month from the date object.

  • – monthDateWithTimeZone:

    Creates and returns a new date set to the first day of the month from the date object. Things get tricky with respect to day light saving. Simple subtraction of a give time (using @code[NSDate dateWithTimeIntervalSinceNow:]@endcode) might not yield the expected results.

  • – isSameDay:

    Returns whether the compared date shares the date with respect to the default time zone.

  • – isSameDay:timeZone:

    Returns whether the compared date shares the date with respect to the given time zone.

  • – isSameMonth:

    Returns whether the compared date shares the month with respect to the given time zone.

  • – isSameMonth:timeZone:

    Returns whether the compared date shares the month with respect to the given time zone.

  • – isSameYear:

    Returns whether the compared date shares the year with respect to the given time zone.

  • – isSameYear:timeZone:

    Returns whether the compared date shares the year with respect to the given time zone.

  • – monthsBetweenDate:

    Returns number of months between two dates.

  • – monthsBetweenDate:timeZone:

    Returns number of months between two dates.

  • – isToday

    Returns a Boolean value that indicates whether the date object is that same date information as the current day.

  • – isTodayWithTimeZone:

    Returns a Boolean value that indicates whether the date object is that same date information as the current day.

  • – isTomorrow

    Returns a Boolean value that indicates whether the date object is that same date information as tomorrow.

  • – isTomorrowWithTimeZone:

    Returns a Boolean value that indicates whether the date object is that same date information as tomorrow.

  • – isYesterday

    Returns a Boolean value that indicates whether the date object is that same date information as yesterday.

  • – isYesterdayWithTimeZone:

    Returns a Boolean value that indicates whether the date object is that same date information as yesterday.

  • – monthYearString

    Returns a NSString with the localized month and year string for the NSDate object.

  • – monthYearStringWithTimeZone:

    Returns a NSString with the localized month and year string for the NSDate object.

  • – monthString

    Returns a NSString with the localized month string for the NSDate object.

  • – monthStringWithTimeZone:

    Returns a NSString with the localized month string for the NSDate object.

  • – yearString

    Returns a NSString with the localized year string for the NSDate object.

  • – yearStringWithTimeZone:

    Returns a NSString with the localized year string for the NSDate object.

  • + dateWithDateComponents:

    Returns a NSDate from the given component information for the gregorian calendar.

  • – dateComponentsWithTimeZone:

    Returns an NSDateComponents object from the NSDate object with respect to the given time zone and gregorian calendar.

Class Methods

dateWithDateComponents:

Returns a NSDate from the given component information for the gregorian calendar.

+ (NSDate *)dateWithDateComponents:(NSDateComponents *)components

Parameters

components

The information used to create the date.

Return Value

A NSDate object.

Discussion

Returns a NSDate from the given component information for the gregorian calendar.

Declared In

NSDate+TKCategory.h

month

Creates and returns a new date set to the current month date.

+ (NSDate *)month

Return Value

A NSDate object set to the current month.

Discussion

Creates and returns a new date set to the current month date.

Declared In

NSDate+TKCategory.h

monthWithTimeZone:

Creates and returns a new date set to the current month date. Things get tricky with respect to day light saving. Simple subtraction of a give time (using @code[NSDate dateWithTimeIntervalSinceNow:]@endcode) might not yield the expected results.

+ (NSDate *)monthWithTimeZone:(NSTimeZone *)timeZone

Parameters

timeZone

The time zone to repect.

Return Value

A NSDate object set to the current month.

Discussion

Creates and returns a new date set to the current month date. Things get tricky with respect to day light saving. Simple subtraction of a give time (using @code[NSDate dateWithTimeIntervalSinceNow:]@endcode) might not yield the expected results.

Declared In

NSDate+TKCategory.h

tomorrow

Creates and returns a new date set to tomorrow’s day and current time.

+ (NSDate *)tomorrow

Return Value

A NSDate object set to tomorrow.

Discussion

Creates and returns a new date set to tomorrow’s day and current time.

Declared In

NSDate+TKCategory.h

tomorrowWithTimeZone:

Creates and returns a new date set to the tomorrow’s day and current time. Things get tricky with respect to day light saving. Simple subtraction of 24 hours (using @code[NSDate dateWithTimeIntervalSinceNow:]@endcode) might not yield the expected results.

+ (NSDate *)tomorrowWithTimeZone:(NSTimeZone *)timeZone

Parameters

timeZone

The time zone to repect.

Return Value

A NSDate object set to tomorrow.

Discussion

Creates and returns a new date set to the tomorrow’s day and current time. Things get tricky with respect to day light saving. Simple subtraction of 24 hours (using @code[NSDate dateWithTimeIntervalSinceNow:]@endcode) might not yield the expected results.

Declared In

NSDate+TKCategory.h

yesterday

Creates and returns a new date set to the previous day and current time.

+ (NSDate *)yesterday

Return Value

A NSDate object set to yesterday.

Discussion

Creates and returns a new date set to the previous day and current time.

Declared In

NSDate+TKCategory.h

yesterdayWithTimeZone:

Creates and returns a new date set to the previous day and current time. Things get tricky with respect to day light saving. Simple subtraction of 24 hours (using @code[NSDate dateWithTimeIntervalSinceNow:]@endcode) might not yield the expected results.

+ (NSDate *)yesterdayWithTimeZone:(NSTimeZone *)timeZone

Parameters

timeZone

The time zone to repect.

Return Value

A NSDate object set to yesterday.

Discussion

Creates and returns a new date set to the previous day and current time. Things get tricky with respect to day light saving. Simple subtraction of 24 hours (using @code[NSDate dateWithTimeIntervalSinceNow:]@endcode) might not yield the expected results.

Declared In

NSDate+TKCategory.h

Instance Methods

dateComponentsWithTimeZone:

Returns an NSDateComponents object from the NSDate object with respect to the given time zone and gregorian calendar.

- (NSDateComponents *)dateComponentsWithTimeZone:(NSTimeZone *)timeZone

Parameters

timeZone

The time zone to respect.

Return Value

A NSDateComponents object.

Discussion

Returns an NSDateComponents object from the NSDate object with respect to the given time zone and gregorian calendar.

Declared In

NSDate+TKCategory.h

isSameDay:

Returns whether the compared date shares the date with respect to the default time zone.

- (BOOL)isSameDay:(NSDate *)anotherDate

Parameters

anotherDate

The date to compare.

Return Value

YES if the two dates share the same year, month and day. Otherwise NO.

Discussion

Returns whether the compared date shares the date with respect to the default time zone.

Declared In

NSDate+TKCategory.h

isSameDay:timeZone:

Returns whether the compared date shares the date with respect to the given time zone.

- (BOOL)isSameDay:(NSDate *)anotherDate timeZone:(NSTimeZone *)timeZone

Parameters

anotherDate

The date to compare.

timeZone

The time zone used to determine the current day.

Return Value

YES if the two dates share the same year, month and day. Otherwise NO.

Discussion

Returns whether the compared date shares the date with respect to the given time zone.

Declared In

NSDate+TKCategory.h

isSameMonth:

Returns whether the compared date shares the month with respect to the given time zone.

- (BOOL)isSameMonth:(NSDate *)anotherDate

Parameters

anotherDate

The date to compare.

Return Value

YES if the two dates share the same year, month. Otherwise NO.

Discussion

Returns whether the compared date shares the month with respect to the given time zone.

Declared In

NSDate+TKCategory.h

isSameMonth:timeZone:

Returns whether the compared date shares the month with respect to the given time zone.

- (BOOL)isSameMonth:(NSDate *)anotherDate timeZone:(NSTimeZone *)timeZone

Parameters

anotherDate

The date to compare.

timeZone

The time zone used to determine the current day.

Return Value

YES if the two dates share the same year, month. Otherwise NO.

Discussion

Returns whether the compared date shares the month with respect to the given time zone.

Declared In

NSDate+TKCategory.h

isSameYear:

Returns whether the compared date shares the year with respect to the given time zone.

- (BOOL)isSameYear:(NSDate *)anotherDate

Parameters

anotherDate

The date to compare.

Return Value

YES if the two dates share the same year. Otherwise NO.

Discussion

Returns whether the compared date shares the year with respect to the given time zone.

Declared In

NSDate+TKCategory.h

isSameYear:timeZone:

Returns whether the compared date shares the year with respect to the given time zone.

- (BOOL)isSameYear:(NSDate *)anotherDate timeZone:(NSTimeZone *)timeZone

Parameters

anotherDate

The date to compare.

timeZone

The time zone used to determine the current day.

Return Value

YES if the two dates share the same year. Otherwise NO.

Discussion

Returns whether the compared date shares the year with respect to the given time zone.

Declared In

NSDate+TKCategory.h

isToday

Returns a Boolean value that indicates whether the date object is that same date information as the current day.

- (BOOL)isToday

Return Value

YES if the date object represents the current date, otherwise NO.

Discussion

Returns a Boolean value that indicates whether the date object is that same date information as the current day.

Declared In

NSDate+TKCategory.h

isTodayWithTimeZone:

Returns a Boolean value that indicates whether the date object is that same date information as the current day.

- (BOOL)isTodayWithTimeZone:(NSTimeZone *)timeZone

Parameters

timeZone

The time zone to respect.

Return Value

YES if the date object represents the current date, otherwise NO.

Discussion

Returns a Boolean value that indicates whether the date object is that same date information as the current day.

Declared In

NSDate+TKCategory.h

isTomorrow

Returns a Boolean value that indicates whether the date object is that same date information as tomorrow.

- (BOOL)isTomorrow

Return Value

YES if the date object represents tomorrow’s date, otherwise NO.

Discussion

Returns a Boolean value that indicates whether the date object is that same date information as tomorrow.

Declared In

NSDate+TKCategory.h

isTomorrowWithTimeZone:

Returns a Boolean value that indicates whether the date object is that same date information as tomorrow.

- (BOOL)isTomorrowWithTimeZone:(NSTimeZone *)timeZone

Parameters

timeZone

The time zone to respect.

Return Value

YES if the date object represents tomorrow’s date, otherwise NO.

Discussion

Returns a Boolean value that indicates whether the date object is that same date information as tomorrow.

Declared In

NSDate+TKCategory.h

isYesterday

Returns a Boolean value that indicates whether the date object is that same date information as yesterday.

- (BOOL)isYesterday

Return Value

YES if the date object represents yesterday’s date, otherwise NO.

Discussion

Returns a Boolean value that indicates whether the date object is that same date information as yesterday.

Declared In

NSDate+TKCategory.h

isYesterdayWithTimeZone:

Returns a Boolean value that indicates whether the date object is that same date information as yesterday.

- (BOOL)isYesterdayWithTimeZone:(NSTimeZone *)timeZone

Parameters

timeZone

The time zone to respect.

Return Value

YES if the date object represents yesterday’s date, otherwise NO.

Discussion

Returns a Boolean value that indicates whether the date object is that same date information as yesterday.

Declared In

NSDate+TKCategory.h

monthDate

Creates and returns a new date set to the first day of the month from the date object.

- (NSDate *)monthDate

Return Value

A NSDate object set to the same month as the date object. The day will be the first of the month.

Discussion

Creates and returns a new date set to the first day of the month from the date object.

Declared In

NSDate+TKCategory.h

monthDateWithTimeZone:

Creates and returns a new date set to the first day of the month from the date object. Things get tricky with respect to day light saving. Simple subtraction of a give time (using @code[NSDate dateWithTimeIntervalSinceNow:]@endcode) might not yield the expected results.

- (NSDate *)monthDateWithTimeZone:(NSTimeZone *)timeZone

Parameters

timeZone

Time Zone for month.

Return Value

A NSDate object set to the same month as the date object. The day will be the first of the month.

Discussion

Creates and returns a new date set to the first day of the month from the date object. Things get tricky with respect to day light saving. Simple subtraction of a give time (using @code[NSDate dateWithTimeIntervalSinceNow:]@endcode) might not yield the expected results.

Declared In

NSDate+TKCategory.h

monthString

Returns a NSString with the localized month string for the NSDate object.

- (NSString *)monthString

Return Value

An NSString object.

Discussion

Returns a NSString with the localized month string for the NSDate object.

Declared In

NSDate+TKCategory.h

monthStringWithTimeZone:

Returns a NSString with the localized month string for the NSDate object.

- (NSString *)monthStringWithTimeZone:(NSTimeZone *)timeZone

Parameters

timeZone

The time zone to respect.

Return Value

An NSString object.

Discussion

Returns a NSString with the localized month string for the NSDate object.

Declared In

NSDate+TKCategory.h

monthYearString

Returns a NSString with the localized month and year string for the NSDate object.

- (NSString *)monthYearString

Return Value

An NSString object.

Discussion

Returns a NSString with the localized month and year string for the NSDate object.

Declared In

NSDate+TKCategory.h

monthYearStringWithTimeZone:

Returns a NSString with the localized month and year string for the NSDate object.

- (NSString *)monthYearStringWithTimeZone:(NSTimeZone *)timeZone

Parameters

timeZone

The time zone to respect.

Return Value

An NSString object.

Discussion

Returns a NSString with the localized month and year string for the NSDate object.

Declared In

NSDate+TKCategory.h

monthsBetweenDate:

Returns number of months between two dates.

- (NSInteger)monthsBetweenDate:(NSDate *)date

Parameters

date

The other date to compare.

Return Value

Returns number of months between two dates.

Discussion

Returns number of months between two dates.

Declared In

NSDate+TKCategory.h

monthsBetweenDate:timeZone:

Returns number of months between two dates.

- (NSInteger)monthsBetweenDate:(NSDate *)toDate timeZone:(NSTimeZone *)timeZone

Parameters

toDate

The other date to compare.

timeZone

The time zone to respect.

Return Value

Returns number of months between two dates.

Discussion

Returns number of months between two dates.

Declared In

NSDate+TKCategory.h

yearString

Returns a NSString with the localized year string for the NSDate object.

- (NSString *)yearString

Return Value

An NSString object.

Discussion

Returns a NSString with the localized year string for the NSDate object.

Declared In

NSDate+TKCategory.h

yearStringWithTimeZone:

Returns a NSString with the localized year string for the NSDate object.

- (NSString *)yearStringWithTimeZone:(NSTimeZone *)timeZone

Parameters

timeZone

The time zone to respect.

Return Value

An NSString object.

Discussion

Returns a NSString with the localized year string for the NSDate object.

Declared In

NSDate+TKCategory.h