Top "Nscalendar" questions

NSCalendar is an Apple MacOS and iOS class to deal with calendrical computation.

Making Date With Given Numbers

I have the following Swift (Swift 3) function to make a date (Date) with date components (DateComponents). func makeDate(year: Int, …

swift3 nsdate nscalendar nsdatecomponents
Swift 2.0 calendar components error

Hi I get this error in swift 2.0 Cannot invoke 'components' with an argument list of type '(NSCalendarUnit, fromDate: NSDate?, …

ios swift nscalendar
How to subtract date components?

As today is Friday, which is 6 according to NSCalendar. I can get this by using the following Calendar.current.component(.…

ios swift nscalendar
Calendar API - iOS7

Is there any calendar API for iPad? Please refer to image. This is calendar application in iOS7

iphone ios fullcalendar nscalendar ios7
[NSCFString timeIntervalSinceReferenceDate]: unrecognized selector sent to instance

I would like to compare difference between two dates, but with the code below I got the error "[NSCFString timeIntervalSinceReferenceDate]: …

ios nsdate nscalendar nstimeinterval
NSDate, NSCalendar and NSDateComponents timing

NSDate *today = [NSDate date]; NSCalendar *calendar = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar]; [calendar setTimeZone:[NSTimeZone timeZoneWithName:@"GMT+2"]]; NSDateComponents *dateComponents = [calendar components:(NSDayCalendarUnit | …

iphone cocoa nsdate nscalendar nsdatecomponents
NSCalendar dateFromComponents: GMT timezone instead of systemTimeZone

This code NSCalendar *calendar =[NSCalendar currentCalendar]; [gregorian setTimeZone:tz]; NSLog(@"%@", [gregorian timeZone]); NSDateComponents *comp = [gregorian components:(NSYearCalendarUnit | NSMonthCalendarUnit) fromDate:[NSDate …

iphone ios nscalendar nstimezone
Swift 4 : Set Different Date and Time

I know how to get local date and time, but what I want to do is getting the date and …

ios swift nsdate nscalendar nsdatecomponents
NSDate - one year ago, dilemma

I'm trying to do something that, for me, is a bit difficult. But I'm sure someone has some insight. Given …

iphone objective-c ios nsdate nscalendar