title: Time calculation giving increasingly wrong result
body: <p>I need to create a Timer that counts down from a string I get from the server. the string outputs total seconds left.</p>
  
  <p>I am using this code - it calculates the initial number time right and it counts down but the minutes are the problem.</p>
  
  <p>EDIT - Every real minute the minute calculation goes up by one. But I don't understand why it is doing this.</p>
  
  <p>-(void)showTimmer:(id) sender {</p>
  
  <pre><code>//get total amount of seconds
  
  NSString *timeRaw =  [ArrayFromServer objectAtIndex:1];
  NSArray *timeArr = [timeRaw componentsSeparatedByString:@","];
  timetoInt =  [timeArr objectAtIndex:0];
  int time1 = [timetoInt intValue];
  
  //set the second countdown
  
  NSDate* now = [NSDate date];    
  NSCalendar *gregorian = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
  
  NSDateComponents *dateComponents = [gregorian components:(NSSecondCalendarUnit) fromDate:now];
  
  NSInteger seconds = time1 - [dateComponents second];
  
  [gregorian release];
  
  // do the hours days maths
  
  int hour = (seconds / 3600 );
  seconds -= hour * 3600;
  int minute = (seconds / 60 );
  seconds -= minute * 60;
  int second = seconds;
  
  //set the labels
  
  countdownLabel.text = [NSString stringWithFormat:@"%02dH %02dM %02ds", hour, minute, second];
  </code></pre>