Amazon.com Widgets Comparing NSDate
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 19, 2014, 10:26:32 AM
Home Help Search chat Login Register   
News: Read this please.The Great Kangaroo Escape Looking for reviews of the 4th ed on Amazon!   Twitter:  @skochan
                     

+  Official Forum for Programming in Objective-C (the iPhone Programming Language) - Stephen Kochan
|-+  Old Stuff
| |-+  Shared Code Library
| | |-+  Comparing NSDate
Pages: [1]   Go Down
Print
Author Topic: Comparing NSDate  (Read 2390 times)
adamgonzalez1984
Jr. Member
**
Posts: 89






« on: January 13, 2010, 03:37:42 PM »

Code: (Objective-C)
NSDate *dateOne = [NSDate dateWithString:@"2008-12-04 03:00:00 +0900"];
NSDate *dateTwo = [NSDate dateWithString:@"2008-12-04 04:00:00 +0900"];

switch ([dateOne compare:dateTwo]){
      case NSOrderedAscending:
             NSLog(@”NSOrderedAscending”);
             break;
      case NSOrderedSame:
            NSLog(@”NSOrderedSame”);
            break;
      case NSOrderedDescending:
            NSLog(@”NSOrderedDescending”);
            break;
}
« Last Edit: January 13, 2010, 07:30:41 PM by skochan » Logged
Pages: [1]   Go Up
Print
Jump to:  



Login with username, password and session length

Powered by MySQL Powered by PHP Powered by SMF 1.1.11 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!
Entire forum contents (c) 2009 classroomM.com. All rights reserved.