How do i convert an NSDateFormatter to integer?

i have this code to work with:

```
     NSDateFormatter *timeOfDayInt = [[[NSDateFormatter alloc] init] autorelease];
     [timeOfDayInt setDateFormat:@"HHmm"];
    int currentTime = (int)[timeOfDayInt stringFromDate:[NSDate date]];

    if(currentTime >= 1400 && currentTime <= 1500) {
     //do something
}

```

Strangly, this code worked like a day ago, now it returns some weird numbers...
i really cant find a souloution of the problem and i would appriciate an answer..
Thanks!

PS:

If I log the time, `NSLog(@"%@",[timeOfDayInt stringFromDate:[NSDate date]]);`

it logs correctly.. why dosn't it work?