Network Time Protocol for iPhone

前端 未结 7 2095
無奈伤痛
無奈伤痛 2020-11-30 04:38

I am writing an application that requires accurate timing. After asking this question, I have decided to investigate using NTP or maybe Simple NTP.

Is there any open

7条回答
  •  北海茫月
    2020-11-30 05:31

    You can use that open source: https://github.com/huynguyencong/NHNetworkTime

    [[NHNetworkClock sharedNetworkClock] syncWithComplete:^{
            NSLog(@"%s - Time synced %@", __PRETTY_FUNCTION__, [NSDate networkDate]);
        }];
    

    And use:

    NSDate *networkDate = [NSDate networkDate];
    

提交回复
热议问题