almost 11 years ago
The following code changes the day from the given "date" for example: if you want to add or subtract 5 days from the date put a value 5 or -5 respectively for "timeSliceDay".
-(NSString *)getTimeSliceDate:(NSString *)date format:(NSString *)format returnFormat:(NSString *)returnFormat timeSliceDay:(int)timeSliceDay{ NSDate *dated = [self dateFromString:date format:format]; dated = [dated dateByAddingTimeInterval:timeSliceDay*24*60*60]; return [self stringFromDate:dated format:returnFormat]; } -(NSDate*)dateFromString:(NSString *)dateString format:(NSString *)format { NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; [formatter setDateFormat:format]; return [formatter dateFromString:dateString]; } -(NSString*)stringFromDate:(NSDate *)date format:(NSString *)format { NSDateFormatter *formatter = [[NSDateFormatter alloc]init]; [formatter setDateFormat:format]; return [formatter stringFromDate:date]; }
Starting with Chrome version 45, NPAPI is no longer supported for Google Chrome. For more information, see Chrome and NPAPI (blog.chromium.org).
Firefox and Microsoft Internet Explorer are recommended browsers for websites using java applets.
Chrome Version Support
Are you sure, you want to delete this comment?
Sign up using
0 Comment(s)