2

我想知道是否有任何方法可以在不使用互联网连接的情况下找到下一分钟的 UTC 时间。我必须在给定的时间点执行一个动作(在多个设备上一次播放歌曲而没有延迟)。

4

1 回答 1

0

由于 NSDate 始终采用 UTC,因此您可以:

NSDateComponents *minuteComponent = [[NSDateComponents alloc] init];
minuteComponent.minute = 1;
NSCalendar *theCalendar = [NSCalendar currentCalendar];
NSDate *nextMinuteDate = [theCalendar dateByAddingComponents:minuteComponent toDate:[NSDate date] options:0];
NSLog(@"%@",nextMinuteDate);
于 2013-09-30T10:53:45.353 回答