How can i do the following operations on NSDate variables?
How to compare two NSDate variables?
How to find difference between two NSDate variables?
How to get each separate value of minute, hours and days from NSDate variable?
We can get the current date by
NSDate *currentDate=[NSDate date];
But it will give the result of yyyy-mm-dd hh:mm:ss GMT
From this, can i get hour field alone? or month value only?
From NSDate
class reference, you have instance methods to do these -
isEqualToDate:
timeIntervalSinceDate:
PS: Use Google to the maximum.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.