I am having a date as 2010-08-02 which is 2nd August 2010 now i want to dispaly this as Monday,8 August ,2010
Thanks for the help
views:
38answers:
1
+1
A:
You should take a look at NSDateFormatter and if neccessary create your own formatter from a String like in the second link (The last listing).
NSDateFormatter *inputFormatter = [[NSDateFormatter alloc] init];
[inputFormatter setDateFormat:@"yyyy-MM-dd"];
NSDateFormatter *outputFormatter = [[NSDateFormatter alloc] init];
[outputFormatter setDateFormat:@"EEEE',' d MMMM yyyy"];
NSDate *date = [inputFormatter dateFromString:@"2010-08-02"];
NSString *dateString = [outputFormatter stringFromDate:date];
NSLog(@"%@", dateString);
[inputFormatter release];
[outputFormatter release];
nacho4d
2010-08-03 05:35:02
ya thanks it really worked
mrugen
2010-08-04 06:26:29