• <i id='FMEuh'><tr id='FMEuh'><dt id='FMEuh'><q id='FMEuh'><span id='FMEuh'><b id='FMEuh'><form id='FMEuh'><ins id='FMEuh'></ins><ul id='FMEuh'></ul><sub id='FMEuh'></sub></form><legend id='FMEuh'></legend><bdo id='FMEuh'><pre id='FMEuh'><center id='FMEuh'></center></pre></bdo></b><th id='FMEuh'></th></span></q></dt></tr></i><div id='FMEuh'><tfoot id='FMEuh'></tfoot><dl id='FMEuh'><fieldset id='FMEuh'></fieldset></dl></div>

    1. <small id='FMEuh'></small><noframes id='FMEuh'>

    2. <legend id='FMEuh'><style id='FMEuh'><dir id='FMEuh'><q id='FMEuh'></q></dir></style></legend>
        • <bdo id='FMEuh'></bdo><ul id='FMEuh'></ul>
        <tfoot id='FMEuh'></tfoot>

        如何比较iphone中的两个日期?

        时间:2023-10-23
          <tbody id='z4USH'></tbody>

              <legend id='z4USH'><style id='z4USH'><dir id='z4USH'><q id='z4USH'></q></dir></style></legend>

              <small id='z4USH'></small><noframes id='z4USH'>

                <bdo id='z4USH'></bdo><ul id='z4USH'></ul>
                1. <i id='z4USH'><tr id='z4USH'><dt id='z4USH'><q id='z4USH'><span id='z4USH'><b id='z4USH'><form id='z4USH'><ins id='z4USH'></ins><ul id='z4USH'></ul><sub id='z4USH'></sub></form><legend id='z4USH'></legend><bdo id='z4USH'><pre id='z4USH'><center id='z4USH'></center></pre></bdo></b><th id='z4USH'></th></span></q></dt></tr></i><div id='z4USH'><tfoot id='z4USH'></tfoot><dl id='z4USH'><fieldset id='z4USH'></fieldset></dl></div>
                2. <tfoot id='z4USH'></tfoot>

                3. 本文介绍了如何比较iphone中的两个日期?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我想比较今天的日期和来自我的数据库的其他日期.例如,2011-03-25 与 2011-02-25 比较

                  I want to compare the todays date and other date coming from my database. For example, 2011-03-25 compare it with 2011-02-25

                  由于 NSDateFormatter 需要 NSDdate 数据类型,我如何格式化我的数据库日期?

                  How can i formate my database date as the NSDateFormatter require NSDdate datatype ?

                  推荐答案

                  Cocoa 有两种方法:

                  在 NSDate 中

                  – isEqualToDate:
                  – 较早日期:
                  – 稍后日期:
                  – 比较:

                  – isEqualToDate:
                  – earlierDate:
                  – laterDate:
                  – compare:

                  当你使用 - (NSComparisonResult)compare:(NSDate *)anotherDate 时,你会得到其中之一:

                  When you use - (NSComparisonResult)compare:(NSDate *)anotherDate ,you get back one of these:

                  The receiver and anotherDate are exactly equal to each other, NSOrderedSame
                  The receiver is later in time than anotherDate, NSOrderedDescending
                  The receiver is earlier in time than anotherDate, NSOrderedAscending.
                  

                  有关更多信息,请阅读 SO 帖子

                  for more read the SO post

                  浏览一下博文,有很多与日期相关的实用功能.

                  Just go through the blog post, there are many date related utility functions.

                  http://arstechnica.com/apple/guides/2010/03/how-to-real-world-dates-with-the-iphone-sdk.ars/2

                  这篇关于如何比较iphone中的两个日期?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  上一篇:修复位置:在 iOS 4 中修复 下一篇:将 NSMutableArray 传递给一个视图控制器到另一个

                  相关文章

                  <tfoot id='fckzr'></tfoot>

                  1. <small id='fckzr'></small><noframes id='fckzr'>

                    <legend id='fckzr'><style id='fckzr'><dir id='fckzr'><q id='fckzr'></q></dir></style></legend>
                    <i id='fckzr'><tr id='fckzr'><dt id='fckzr'><q id='fckzr'><span id='fckzr'><b id='fckzr'><form id='fckzr'><ins id='fckzr'></ins><ul id='fckzr'></ul><sub id='fckzr'></sub></form><legend id='fckzr'></legend><bdo id='fckzr'><pre id='fckzr'><center id='fckzr'></center></pre></bdo></b><th id='fckzr'></th></span></q></dt></tr></i><div id='fckzr'><tfoot id='fckzr'></tfoot><dl id='fckzr'><fieldset id='fckzr'></fieldset></dl></div>
                      <bdo id='fckzr'></bdo><ul id='fckzr'></ul>