How can I compare two different dates to find out which is the later date? For example, in date1
I will store one date after downloading some data, and in date2
, I will store the current date. Then I need to check which one is greater/later: something like if(date1>date2)
.
Something like:
NSDate* timeNow = [NSDate date];
// If less than 30 seconds, do something
if ([timeNow timeIntervalSinceDate:anEarlierTime] < 30.0f)
{
// Do something
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With