如何获取 iPhone 中过去和未来日期的值
我正在制作一个应用程序,其中我从服务器获取一些事件响应,如果有一些日期与该事件相关,我需要知道如何区分这两个日期,在我的应用程序中有两个分段栏,第一个是即将发生的事件,第二个是过去的事件,现在我需要以这种格式显示与日期相关的事件,意味着下一个事件即将到来,需要在即将发生的事件中显示,而已经发生的事件需要显示在过去的事件中,所有日期均来自网络服务器dd/mm/year 格式,我已将所有日期存储在数组中并将它们显示在表格中,但是如何区分即将到来的日期和过去的日期。
I am making an appplication in which i am getting some event response from the server, in the event there are some dates coming related to that event, i need to know how to differentiate between the two dates, In my application there are two segment bars, first one is upcoming events, and second is past events, now i need to show the event related to date in such format, means event is coming in next, need to be show in upcoming events and the events which have gone need to show in past event, All the date are coming from webserver in dd/mm/year format, i have stored all the dates in array and display them in table, however how to differentiate between the coming date and past dates.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
请阅读“日期和时间编程指南”。这是解决您所有问题的绝佳资源。我强烈推荐您章节“从组件创建日期" 和 "历法计算”。
Please read the "Date and Time Programming Guide". It's a great resource for all of your questions. I'd highly recommend you chapters "Creating a Date from Components" and "Calendrical Calculations".