iPhone time comparison
        Posted  
        
            by Rob
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Rob
        
        
        
        Published on 2010-06-14T04:30:47Z
        Indexed on 
            2010/06/14
            4:42 UTC
        
        
        Read the original article
        Hit count: 222
        
iphone
|objective-c
I am trying to figure out how to create an 'if' statement that uses a time value as a condition. For example:
if (time <= 10:00) {
    score = 3;
} else if (time <= 20:00) {
    score = 5;
} else {
            score = 9;
}   
I know that a string of "5:23" cannot be compared this way but I don't think I can just turn a string value like that directly into an integer. Any thoughts?
© Stack Overflow or respective owner