Declared in NSDate+BFKit.h

Overview

This category adds some useful methods to NSDate

Tasks

Class Methods

dateFromDateInformation:

+ (NSDate *_Nonnull)dateFromDateInformation:(BFDateInformation)info
Discussion

Returns a date from a given BFDateInformation structure

Parameters

info

The BFDateInformation to be converted

Return Value

Returns a NSDate from a given BFDateInformation structure

Declared In

NSDate+BFKit.h

dateFromDateInformation:timeZone:

+ (NSDate *_Nonnull)dateFromDateInformation:(BFDateInformation)info timeZone:(NSTimeZone *_Nonnull)timezone
Discussion

Returns a date from a given BFDateInformation structure with a given time zone

Parameters

info

The BFDateInformation to be converted

timezone

The timezone

Return Value

Returns a NSDate from a given BFDateInformation structure with a given time zone

Declared In

NSDate+BFKit.h

dateInformationDescriptionWithInformation:

+ (NSString *_Nonnull)dateInformationDescriptionWithInformation:(BFDateInformation)info
Discussion

Get the given BFDateInformation structure as a formatted string Default dateSeparator = “/” and usFormat to NO

Parameters

info

The BFDateInformation to be formatted

Return Value

Returns a NSString in the following format: D/M/Y H:M:S Example: 15/10/2013 10:38:43

Declared In

NSDate+BFKit.h

dateInformationDescriptionWithInformation:dateSeparator:usFormat:nanosecond:

+ (NSString *_Nonnull)dateInformationDescriptionWithInformation:(BFDateInformation)info dateSeparator:(NSString *_Nonnull)dateSeparator usFormat:(BOOL)usFormat nanosecond:(BOOL)nanosecond
Discussion

Get the given BFDateInformation structure as a formatted string

Parameters

info

The BFDateInformation to be formatted

dateSeparator

The string to be used as date separator

usFormat

Set if the timestamp is in US format or not

nanosecond

Set if the timestamp has to have the nanosecond

Return Value

Returns a NSString in the following format (dateSeparator = “/”, usFormat to false and nanosecond to false). D/M/Y H:M:S. Example: 15/10/2013 10:38:43 D/M/Y H:M:S Example: 15/10/2013 10:38:43

Declared In

NSDate+BFKit.h

dateWithDatePart:andTimePart:

+ (NSDate *_Nonnull)dateWithDatePart:(NSDate *_Nonnull)aDate andTimePart:(NSDate *_Nonnull)aTime
Discussion

Create an NSDate with other two NSDate objects. Taken from the first date: day, month and year. Taken from the second date: hours and minutes.

Parameters

aDate

The first date for date

aTime

The second date for time

Return Value

Returns the created NSDate

Declared In

NSDate+BFKit.h

month

+ (NSDate *_Nonnull)month
Discussion

Get the month from today

Return Value

Returns the month

Declared In

NSDate+BFKit.h

monthStringWithMonthNumber:

+ (NSString *_Nonnull)monthStringWithMonthNumber:(NSInteger)month
Discussion

Get the month as a localized string from the given month number

Parameters

month

The month to be converted in string [1 - January] [2 - February] [3 - March] [4 - April] [5 - May] [6 - June] [7 - July] [8 - August] [9 - September] [10 - October] [11 - November] [12 - December]

Return Value

Returns the given month as a localized string

Declared In

NSDate+BFKit.h

yesterday

+ (NSDate *_Nonnull)yesterday
Discussion

Create a NSDate with the yesterday date

Return Value

Returns a NSDate with the yesterday date

Declared In

NSDate+BFKit.h

Instance Methods

dateByAddingDays:

- (NSDate *_Nonnull)dateByAddingDays:(NSUInteger)days
Discussion

Add days to self

Parameters

days

The number of days to add

Return Value

Returns self by adding the gived days number

Declared In

NSDate+BFKit.h

dateInformation

- (BFDateInformation)dateInformation
Discussion

Get self as a BFDateInformation structure

Return Value

Returns self as a BFDateInformation structure

Declared In

NSDate+BFKit.h

dateInformationWithTimeZone:

- (BFDateInformation)dateInformationWithTimeZone:(NSTimeZone *_Nonnull)timezone
Discussion

Get self as a BFDateInformation structure with a given time zone

Parameters

timezone

The timezone

Return Value

Returns self as a BFDateInformation structure with a given time zone

Declared In

NSDate+BFKit.h

dayFromWeekday

- (NSString *_Nonnull)dayFromWeekday
Discussion

Get the weekday as a localized string from self

Return Value

Returns weekday as a localized string [1 - Sunday] [2 - Monday] [3 - Tuerday] [4 - Wednesday] [5 - Thursday] [6 - Friday] [7 - Saturday]

Declared In

NSDate+BFKit.h

daysBetweenDate:

- (NSInteger)daysBetweenDate:(NSDate *_Nonnull)toDate
Discussion

Get the days number between self and another date

Parameters

toDate

The another date

Return Value

Returns the days between the two dates

Declared In

NSDate+BFKit.h

isSameDay:

- (BOOL)isSameDay:(NSDate *_Nonnull)anotherDate
Discussion

Compare self with another date

Parameters

anotherDate

The another date to compare as NSDate

Return Value

Returns YES if is same day, NO if not

Declared In

NSDate+BFKit.h

isToday

- (BOOL)isToday
Discussion

Returns if self is today

Return Value

Returns if self is today

Declared In

NSDate+BFKit.h

month

- (NSDate *_Nonnull)month
Discussion

Get the month from self

Return Value

Returns the month

Declared In

NSDate+BFKit.h

monthString

- (NSString *_Nonnull)monthString
Discussion

Get the month string from self

Return Value

Returns the month string

Declared In

NSDate+BFKit.h

monthsBetweenDate:

- (NSInteger)monthsBetweenDate:(NSDate *_Nonnull)toDate
Discussion

Get the months number between self and another date

Parameters

toDate

The another date

Return Value

Returns the months between the two dates

Declared In

NSDate+BFKit.h

shortDate

- (NSDate *_Nonnull)shortDate
Discussion

Returns date with the year, month and day only

Return Value

Date after removing all components but not year, month and day

Declared In

NSDate+BFKit.h

weekday

- (NSInteger)weekday
Discussion

Get the weekday number from self

Return Value

Returns weekday number [1 - Sunday] [2 - Monday] [3 - Tuerday] [4 - Wednesday] [5 - Thursday] [6 - Friday] [7 - Saturday]

Declared In

NSDate+BFKit.h

yearString

- (NSString *_Nonnull)yearString
Discussion

Get the year string from self

Return Value

Returns the year string

Declared In

NSDate+BFKit.h