How to get the date difference in Hours?
<p>I have a date coming from the database which in this format 2011-11-30 18:38:00 +0000 and i need date difference from now.How it's is possible?this what i am doing:-</p>

<pre><code>  NSDate* pDateEnd;



  NSLog(@"PDateEnd=%@",pDateEnd); //it has value=2011-11-30 18:38:00 +0000

NSTimeInterval secForDeal = [pDateEnd timeIntervalSinceNow];

NSLog(@"secForDeal=%i",secForDeal);
if(secForDeal &lt; 0)
    return nil;
//////
unsigned unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit |  NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit;
NSCalendar *currentCalendar = [NSCalendar currentCalendar];

NSDateComponents* pRemainingDate = [[[NSDateComponents alloc] init] autorelease];

[pRemainingDate setHour:0];

[pRemainingDate setMinute:0];

[pRemainingDate setSecond:secForDeal];

//preparing date 
NSDate *date = [currentCalendar dateFromComponents:pRemainingDate];
//again splitting date to components
NSDateComponents *comps = [currentCalendar components:unitFlags fromDate:date];
/////Generating the date
NSString* pRetTimeRemaining = [NSString stringWithFormat:@"%i Year %i Month %i days %i Hr %i Min",[comps year],[comps month],[comps day],[comps hour],[comps minute]];
///////
NSLog(@"pRetTimeRemaining=%@",pRetTimeRemaining);
return pRetTimeRemaining;
</code></pre>

<p>Please tell if there is any error or another way to do this.Thank you.</p>
