NSDate(ETStringTampering) Category Reference
| Declared in | ETString.h | 
Overview
NSDate (ETStringTampering) is a helper category that provides a bunch of NSString formatting methods.
Formatting
Provided a set of pre-defined formatting methods for the most common NSDate formatting needs.
Components extraction
Provides a set of NSDate components extraction in an easy and straigh forward way.
Tasks
Formatting methods.
- 
	
		
– formatMonthDayYear - 
	
		
– formatYYYYMMdd_HHmmss - 
	
		
– formatUtcTimestamp - 
	
		
– formatUtcDate - 
	
		
– formatAsDeltaFromNow - 
	
		
– formatAsDeltaFromNowWithTimeZoneAdjustment: - 
	
		
– formatMediumDate - 
	
		
– formatMediumDateTime - 
	
		
– formatMMDDYY - 
	
		
– formatMMDDYY: 
Components extraction.
Class Methods
dayOfMonthSuffix:
Returns the day of the month suffix in english.
+ (NSString *)dayOfMonthSuffix:(int)dayOfMonthParameters
- dayOfMonth
 The day of the month to be used as the suffix retrieving “key”.
Return Value
A NSString object containing the pertaining suffix in English for the provided day number.
Discussion
e.g.: [NSString dayOfMonthSuffix:1]; returns st
Declared In
ETString.hInstance Methods
dayOfMonth
Returns the day of month plus suffix for the NSDate instance.
- (NSString *)dayOfMonthReturn Value
A NSString containing the day of the month plus the suffix of the NSDate instance.
Discussion
e.g: 15th
Declared In
ETString.hdayOfWeek
Returns a NSString day of week in English for the NSDate instance.
- (NSString *)dayOfWeekDiscussion
e.g.: ‘Monday’ thru ‘Sunday’
Declared In
ETString.hformatAsDeltaFromNow
Formats the NSDate instance as a NSString in a “human comprehensive” delta.
- (NSString *)formatAsDeltaFromNowReturn Value
A NSString delta containing the time lapse between “now”([NSDate date]) and the NSDate instance.
Discussion
e.g: “22 minutes ago” or “1 day ago”
Declared In
ETString.hformatAsDeltaFromNowWithTimeZoneAdjustment:
Formats the NSDate instance as a NSString in a “human comprehensive” delta with NSTimeZone adjustment if desired.
- (NSString *)formatAsDeltaFromNowWithTimeZoneAdjustment:(BOOL)adjustTimeZoneParameters
- adjustTimeZone
 A boolean flag indicating wether or not to to
NSTimeZoneadjustment to the time lapse calculation.
Return Value
A NSString delta containing the time lapse between “now”([NSDate date]) and the NSDate instance with NSTimeZone adjustment if desired.
Discussion
e.g: “22 minutes ago” or “1 day ago”
Declared In
ETString.hformatMMDDYY
Formats the NSDate instance as a NSString with the following format: @"MM/DD/YY".
- (NSString *)formatMMDDYYReturn Value
A NSString object containing the NSDate instance with the following format: @"MM/DD/YY".
Discussion
e.g.: 10/15/85
Declared In
ETString.hformatMMDDYY:
Formats the NSDate instance as a NSString with the following format: @"MM[separator]DD[separator]YY" with the [separator] provided.
- (NSString *)formatMMDDYY:(NSString *)separatorParameters
- separator
 The
NSStringseparator character that will be used to separate theNSDatecomponents.e.g.: 10 [separator] 15 [separator] 85
Return Value
A NSString object containing the NSDate instance with the following format: @"MM[separator]DD[separator]YY" with the [separator] provided.
Declared In
ETString.hformatMediumDate
Formats the NSDate instance as a NSString with the following time style: NSDateFormatterNoStyle and the following date style: NSDateFormatterShortStyle.
- (NSString *)formatMediumDateReturn Value
A NSString object containing the NSDate instance formatted with NSDateFormatterNoStyle time style and NSDateFormatterShortStyle date style.
Discussion
e.g.: Oct 15, 1985
Declared In
ETString.hformatMediumDateTime
Formats the NSDate instance as a NSString with the following time style: NSDateFormatterMediumStyle and the following date style: NSDateFormatterShortStyle.
- (NSString *)formatMediumDateTimeReturn Value
A NSString object containing the NSDate instance formatted with NSDateFormatterMediumStyle time style and NSDateFormatterShortStyle date style.
Discussion
e.g.: Oct 15, 1985 09:00pm
Declared In
ETString.hformatMonthDayYear
Formats the NSDate instance as a NSString using the following format: MM-DD-YYYY.
- (NSString *)formatMonthDayYearReturn Value
A NSString object containing the NSDate instance formatted with the following formatter: MM-DD-YYYY.
Declared In
ETString.hformatUtcDate
Formats the NSDate instance as a NSString using the following format: @“yyyy-MM-dd” and UTC NSTimeZone.
- (NSString *)formatUtcDateReturn Value
A NSString object containing the NSDate instance formatted with the following formatter: @“yyyy-MM-dd” and UTC NSTimeZone.
Declared In
ETString.hformatUtcTimestamp
Formats the NSDate instance as a NSString using the following format: @“yyyy-MM-dd HH:mm:ss” and UTC NSTimeZone.
- (NSString *)formatUtcTimestampReturn Value
A NSString object containing the NSDate instance formatted with the following formatter: @“yyyy-MM-dd HH:mm:ss” and NSTimeZone.
Declared In
ETString.hformatYYYYMMdd_HHmmss
Formats the NSDate instance as a NSString using the following format: @“yyyy-MM-dd HH:mm:ss”.
- (NSString *)formatYYYYMMdd_HHmmssReturn Value
A NSString object containing the NSDate instance formatted with the following formatter: @“yyyy-MM-dd HH:mm:ss”.
Declared In
ETString.hmonthOfYear
Returns a NSString month of year for the NSDate instance.
- (NSString *)monthOfYearReturn Value
A NSString with the month of the year for the NSDate instance.
Declared In
ETString.hnumberOfYearsUntilNow
Returns the amount of years from the NSDate instance until now([NSDate date]).
- (int)numberOfYearsUntilNowReturn Value
The amount of years from the NSDate instance until now([NSDate date]).
Declared In
ETString.htimeOfDay
Returns a NSString with the time of day with am/pm for the NSDate.
- (NSString *)timeOfDayReturn Value
A NSString containing the time of the day with am/pm for the NSDate instance.
Discussion
e.g.: “9:52 am”
Declared In
ETString.hverboseTimeOfDay
Returns a fully formatted NSString object containing the detailed NSDate instance in English.
- (NSString *)verboseTimeOfDayReturn Value
A fully formatted NSString object containing the detailed NSDate instance in English.
Discussion
e.g.: Monday, October 1st 09:35am
Declared In
ETString.h