Top "Nscalendar" questions

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

NSDate get year/month/day

How can I get the year/month/day of a NSDate object, given no other information? I realize that I …

objective-c nsdate nsdatecomponents nscalendar
Get day of week using NSDate

I created a method that is supposed to take in a string in "YYYY-MM-DD" form and spit out an int …

swift nsdate nscalendar
How to determine if an NSDate is today?

How to check if an NSDate belongs to today? I used to check it using first 10 characters from [aDate description]. [[…

ios objective-c cocoa-touch nsdate nscalendar
first and last day of the current month in swift

I'm trying to get the first and last day of the month in swift. So far I have the following: …

ios swift nsdate nscalendar
iPhone OS: How do I create an NSDate for a specific date?

Seems like a simple thing but I can't seem to find a way to do it. It would be great …

ios cocoa-touch nsdate nsdateformatter nscalendar
Swift 3 - find number of calendar days between two dates

The way I did this in Swift 2.3 was: let currentDate = NSDate() let currentCalendar = NSCalendar.currentCalendar() var startDate : NSDate? var endDate : …

nsdate swift3 nscalendar
How can I get the current month as String?

I need to get may as a current month, but I could not do. How can I achieve this? let …

ios swift date nsdate nscalendar
NSCalendar first day of week

Does anyone know if there is a way to set the first day of the week on a NSCalendar, or …

iphone cocoa calendar weekday nscalendar
Swift - check if a timestamp is yesterday, today, tomorrow, or X days ago

I'm trying to work out how to decide if a given timestamp occurs today, or +1 / -1 days. Essentially, I'd like …

ios swift nsdate nscalendar
How can I set an NSDate object to midnight?

I have an NSDate object and I want to set it to an arbitrary time (say, midnight) so that I …

ios datetime swift nsdate nscalendar