Hey all,
I have a date stored in a postgres database with a time data type. When I send it to objective-c, if I just put it in a field as is, then the field will contain this:
2011-05-10T09:49:00Z
I would like that to be formatted better, so I do this:
But when I do the above, it converts the date into (null).
thanks for response
I have a date stored in a postgres database with a time data type. When I send it to objective-c, if I just put it in a field as is, then the field will contain this:
2011-05-10T09:49:00Z
I would like that to be formatted better, so I do this:
Code:
NSDateFormatter *formatter;
NSString *dateString;
NSDate *date = report.time;
formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"dd-MM-yyyy HH:mm"];
dateString = [formatter stringFromDate:date];
timeTextField.text = [NSString stringWithFormat:@"%@", dateString];
But when I do the above, it converts the date into (null).
thanks for response