2

I wish to know if there is any way to find next minute UTC time without using internet connection. I have to perform an action (play song at a time on multiple devices without lag) at a given point of time.

bneely
  • 9,083
  • 4
  • 38
  • 46
Sundeep Saluja
  • 1,089
  • 2
  • 14
  • 36

1 Answers1

0

Since NSDate is always in UTC, you could:

NSDateComponents *minuteComponent = [[NSDateComponents alloc] init];
minuteComponent.minute = 1;
NSCalendar *theCalendar = [NSCalendar currentCalendar];
NSDate *nextMinuteDate = [theCalendar dateByAddingComponents:minuteComponent toDate:[NSDate date] options:0];
NSLog(@"%@",nextMinuteDate);
Jesper
  • 7,477
  • 4
  • 40
  • 57
mmackh
  • 3,550
  • 3
  • 35
  • 51
  • It did nt help,, If system date is different then it will give different results... :( – Sundeep Saluja Sep 30 '13 at 11:19
  • 1
    There is no physical possible way to perform a synchronised action with wrong dates and no internet connection. You should rethink this part of your app. – mmackh Sep 30 '13 at 11:26