Declared in OCAUtilities.h

Overview

Category extensions to NSDate to facilitate handling and displaying dates.

Class Methods

currentGMTDate

Returns the current date and time in GMT

+ (NSDate *)currentGMTDate

Return Value

NSDate representing the current GMT

Declared In

OCAUtilities.h

Instance Methods

dateStringWithDateStyle:andTimeStyle:

Returns the localized date formatted as requested

- (NSString *)dateStringWithDateStyle:(NSDateFormatterStyle)dateStyle andTimeStyle:(NSDateFormatterStyle)timeStyle

Parameters

dateStyle

Desired date style for the returned string

timeStyle

Desired time style for the returned string

Return Value

Date formatted per the requested style

Declared In

OCAUtilities.h

formattedTimeToDate:

Returns a localized formatted string of the time difference to secondDate

- (NSString *)formattedTimeToDate:(NSDate *)secondDate

Parameters

secondDate

the later date

Return Value

formatted string representing the time difference between the two dates

Discussion

The string will show “a few seconds ago”, minutes, hours, or days appropriately

Declared In

OCAUtilities.h