title: Displaying Date and Time on separate UILabel's in XCode
body: <p>I am adding the date and time to my iOS app. I have successfully added the date but want to show the time on a different label.</p>
  
  <p>My code looks like this but I'm getting an error 'Redefinition of dateFormatter'. What can I do to call the time on a separate label?</p>
  
  <pre><code>    NSLocale *en_US_POSIX = [[NSLocale alloc] initWithLocaleIdentifier:@"en_US_POSIX"];
      assert(en_US_POSIX != nil);
  
      // The Date
  
      //set the date label correctly
      //format the date to July 9 2013 - MMMM d yyyy
      NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
      [dateFormatter setLocale:en_US_POSIX];
      [dateFormatter setDateFormat:@"dd-MM-yyyy"];
      NSDate *dateFromString = [[NSDate alloc] init];
  //    dateFromString = [dateFormatter dateFromString:curDate];
      NSDateFormatter *dateFormat = [[NSDateFormatter alloc] init];
      [dateFormat setDateFormat:@"MMMM d yyyy"];
      NSString *theDate = [dateFormat stringFromDate:dateFromString];
      labelDate.text = theDate;
  
  // The Time
  
  
  
      NSDate *currentTime = [NSDate date];
      NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
      [dateFormatter setDateFormat:@"hh-mm"];
      NSString *resultString = [dateFormatter stringFromDate: currentTime];
      labelTime.text = resultString;
  </code></pre>