-(void) time{
NSDate *now=[nsdate Date];
Nscalendar *cal=[nscalendar Currentcalendar];
unsigned int time=nscalendarunityear| nscalendarunitmonth| nscalendarunitday| nscalendarunithour| nscalendarunitminute| Nscalendarunitsecond;
Nsdatecomponents *t=[cal Components:time Fromdate:now];
int year= (int) [T year];
int mouth= (int) [T month];
int day= (int) [T day];
int hour= (int) [t hour];
int minute= (int) [t minute];
int second=[t Second];
day=day+2;
if (mouth==1| | mouth==3| | mouth==5| | mouth==7| | mouth==8| |mouth==10| | MOUTH==12) {
if (day>31) {
Day=1;
Mouth+=1;
}else{
NSLog (@ "Do not do any processing");
}
}else if (mouth==2) {
if (day>28) {
Day=1;
Mouth+=1;
}else{
NSLog (@ "Do not do any processing");
}
}else{
if (day>30) {
Day=1;
Mouth+=1;
}else{
NSLog (@ "Do not do any processing");
}
}
Self.label2.text=[nsstring stringwithformat:@ "expected%2d-%2d-%2d%2d:%2d before arrival", Year,mouth,day,hour,minute];
NSLog (@ "text:%@", Self.label2.text);
}
IOS gets the current time of the day after tomorrow