The date method returns the current time (now) 02. NSDate *date = [NSDate Date]; 03.//now:11:12:40 04.//date:11:12:50 05. Date = [NSDate datewithtimeintervalsincenow:10];//returns the current time 10 seconds after 06. Starting from 1970-1-1 00:00:00, 07. Date = [NSDate datewithtimeintervalsince1970:10];//returns 1970-1-1 00:00:00 time 10 seconds after 08. Randomly returns a relatively distant future time of 09. Date = [NSDate distantfuture]; 10.//Randomly returns a relatively distant past time of 11. Date = [NSDate distantpast]; 12.//returns the number of milliseconds that began to pass in 1970-1-1 13. Nstimeinterval interval = [date timeIntervalSince1970]; 14.//Compare with other time 15. NSDate *date2 = [NSDate Date]; 16.//Return to the earlier time 17. [Date Earlierdate:date2]; 18.//Return to the time of the comparison later 19. [Date Laterdate:date2]; 20.21. 22.NSDate *date = [NSDate Date]; 23.//2013-04-07-11:14:45 24. NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; //HH is 24 binary, HH is 12 binary 26. Formatter.dateformat = @ "Yyyy-mm-dd HH:mm:ss"; //Formatter.locale = [[[Nslocale alloc] initwithlocaleidentifier:@ "ZH_CN"] autorelease]; NSString *string = [Formatter StringfromdatE:date]; NSLog (@ "%@", string); 30.//The time of the return of the green ruling is 31. NSDate *date2 = [Formatter datefromstring:@ "2010-09-09 13:14:56"];