IOS gets the day after the current time
-(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 (@ "no processing ");
}
} Else if (mouth = 2 ){
If (day> 28 ){
Day = 1;
Mouth + = 1;
} Else {
NSLog (@ "no processing ");
}
} Else {
If (day> 30 ){
Day = 1;
Mouth + = 1;
} Else {
NSLog (@ "no processing ");
}
}
Self. label2.text = [NSString stringWithFormat: @ "estimated % 2d-% 2d-% 2d % 2d: % 2d before arrival", year, mouth, day, hour, minute];
NSLog (@ "text: % @", self. label2.text );
}