Working with NSCalendar -- getting the next first tuesday of a month

Posted by Bjorn S. on Stack Overflow See other posts from Stack Overflow or by Bjorn S.
Published on 2010-03-25T14:29:45Z Indexed on 2010/03/25 14:33 UTC
Read the original article Hit count: 350

Filed under:
|
|

Hi all,

This is a bit odd, but is it possible to use an NSCalendar (or any component, for that matter) to figure out what the date of the next "first tuesday of the month" would be?

For example, today is Thursday March 25, 2010. The next "first tuesday of the month" would be on April 6. Likewise, if I were looking for the next "first tuesday of the month" on April 1, it would still be on April 6.

How would you do this?

Thanks very much!!!!!

© Stack Overflow or respective owner

Related posts about objective-c

Related posts about iphone