Software Testing
iOS obtains the exchange of current time and timestamp
In project development, it is inevitable to encounter the use of the current time, such as the realization of network requests to upload messages, appointments, calendars and other functions.1. Get year, month, day, hour, minute, and secondImplementation code:NSDate *date1 = [NSDate date]; NSDateFormatter *formatter1 = [[NSDateFormatter alloc] init]; [formatter1 setDateStyle:NSDateFormatterMediumStyle]; [formatter1 setTimeStyle:NSDateFormatterShortStyle]; [formatter1 setDateFormat:@"YYYY-MM-dd h