date - iOS 时间计算,月数间隔
怪我咯
怪我咯 2017-04-17 17:14:10
0
3
510

iOS开发中如何获取某三个月之间的秒数,主要现在有个需求,要得到个时间间隔,要求起始时间为现在的时间点,终止时间为某些月后的这个时间点。有没有什么方法,难道必须要做判断吗,什么闰月之类的!!!

iOS是否有原生的方法啊?T__T

怪我咯
怪我咯

走同样的路,发现不同的人生

reply all(3)
PHPzhong

There is no native method from Apple to get this time point after a certain month. There is an open source library on Github that helps with date calculation
https://github.com/DanisFabric/DateSuger You can check it out

刘奇

NSCalendar

迷茫

I would like to recommend you a commonly used time processing library in open source libraries - DateTools, which can accomplish almost everything you want.
If you are interested, you can refer to how it is implemented.
github address: https://github.com/MatthewYork/DateTools

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!