Latest 1.1.0
Homepage https://github.com/giuseppenucifora/NSDate_Utils
License MIT
Platforms ios 8.0, requires ARC
Dependencies DJLocalization
Authors

[![CI Status](http://img.shields.io/travis/Giuseppe Nucifora/NSDate_Utils.svg?style=flat)](https://travis-ci.org/Giuseppe Nucifora/NSDate_Utils)
Version
License
Platform

Usage

To run the example project, clone the repo, and run pod install from the Example directory first.

Requirements

Installation

NSDate_Utils is available through CocoaPods. To install
it, simply add the following line to your Podfile:

pod "NSDate_Utils"
+ (NSCalendar *) sharedCalendar;
+ (NSDateFormatter *) sharedDateFormatter;

+ (NSString *) dateFormatString;
+ (NSString *) timeFormatString;
+ (NSString *) timestampFormatString;
+ (NSString *) dbFormatString;

+ (NSString *) parseDateFormatFromString:(NSString *) dateString;

+ (NSString *) WCFStringFromDate:(NSDate*) date;

+ (NSArray*) getSlotTimesFromDate:(NSDate*) date distanceMinutes:(NSInteger) minutes;

+ (NSDate *) dateFromString:(NSString *) string;
+ (NSDate *) dateFromString:(NSString *) string withFormat:(NSString *) format;
+ (NSDate *) dateFromString:(NSString *) string withFormat:(NSString *) format withTimeZone:(NSTimeZone*) timeZone;
+ (NSString *) stringFromDate:(NSDate *) date withFormat:(NSString *) string;
+ (NSString *) stringFromDate:(NSDate *) date;
+ (NSString *) stringForDisplayFromDate:(NSDate *) date;
+ (NSString *) stringForDisplayFromDate:(NSDate *) date prefixed:(BOOL) prefixed;
+ (NSString *) stringForDisplayFromDate:(NSDate *) date prefixed:(BOOL) prefixed alwaysDisplayTime:(BOOL)displayTime;

+ (NSString *) getUniversalHourFromDateString:(NSString *) string formatterString:(NSString*) formatterString andUppercaseString:(BOOL) uppercaseString;

- (NSDate *) dateToNearestMinutes:(NSInteger)minutes;

- (NSDate *) dateByAddingMinutes:(NSInteger) dMinutes;
- (NSDate *) dateByAddingHours:(NSInteger) hours;
- (NSDate*) dateByAddingDays:(NSInteger) days;
- (NSDate*) dateByAddingYears:(NSInteger) years;

- (NSDate *) dateBySubtractingMinutes:(NSInteger) dMinutes;
- (NSDate *) dateBySubtractingHours:(NSInteger) hours;
- (NSDate *) dateBySubtractingDays:(NSInteger) days;
- (NSDate *) dateBySubtractingYears:(NSInteger) years;

- (NSDate *) dateAtStartOfDay;

- (NSInteger) minutesAfterDate:(NSDate *) aDate;
- (CGFloat) distanceInWeeksToDate:(NSDate *) anotherDate;
- (CGFloat) distanceInDaysToDate:(NSDate *) anotherDate;
- (CGFloat) distanceInHoursToDate:(NSDate *) anotherDate;
- (CGFloat) distanceInMinutesToDate:(NSDate *) anotherDate;
- (CGFloat) distanceInSeconsToDate:(NSDate *) anotherDate;

- (NSDate *) toLocalTime;
- (NSDate *) toGlobalTime;

- (BOOL) isSameYearAsDate:(NSDate *) aDate;
- (BOOL) isEarlierThanDate:(NSDate *) aDate;
- (BOOL) isLaterThanDate:(NSDate *) aDate;

- (NSUInteger) daysAgo;
- (NSUInteger) daysAgoAgainstMidnight;
- (NSString *) stringDaysAgo;
- (NSString *) stringDaysAgoAgainstMidnight:(BOOL)flag;
- (NSUInteger) monthDay;
- (NSUInteger) weekday;
- (NSUInteger) month;
- (NSUInteger) weekNumber;
- (NSUInteger) hour;
- (NSUInteger) minute;
- (NSUInteger) year;
- (long int) utcTimeStamp; //full seconds since

- (NSString *) string;
- (NSString *) stringWithFormat:(NSString *) format;
- (NSString *) stringWithFormat:(NSString *) format timeZone:(NSTimeZone*) timezone;
- (NSString *) stringWithDateStyle:(NSDateFormatterStyle) dateStyle timeStyle:(NSDateFormatterStyle) timeStyle;
- (NSDate *) beginningOfWeek;
- (NSDate *) beginningOfDay;
- (NSDate *) endOfWeek;

- (BOOL)isSameDayAsDate:(NSDate*)otherDate;

- (NSString *) getUniversalHourUppercaseString:(BOOL) uppercaseString;
- (NSString *) getNotificationUniversalHourUppercaseString:(BOOL) uppercaseString;

Author

Giuseppe Nucifora, [email protected]

License

NSDate_Utils is available under the MIT license. See the LICENSE file for more info.

Latest podspec

{
    "name": "NSDate_Utils",
    "version": "1.1.0",
    "summary": "NSDate_Utils is a NSDate category that helps date managements. For example NSString to NSDate, NSDate to NSString,NSSdate comparisons",
    "homepage": "https://github.com/giuseppenucifora/NSDate_Utils",
    "license": "MIT",
    "authors": {
        "Giuseppe Nucifora": "[email protected]"
    },
    "source": {
        "git": "https://github.com/giuseppenucifora/NSDate_Utils.git",
        "tag": "1.1.0"
    },
    "platforms": {
        "ios": "8.0"
    },
    "requires_arc": true,
    "dependencies": {
        "DJLocalization": []
    },
    "source_files": "Pod/Classes/**/*"
}

Pin It on Pinterest

Share This