I have some attribute is date time on this format "2017-06-23 15:34:48".can and I set that to NSDate. But the value is not inserting on the table can anyone help me I added this object as NSDate
2017-06-23 15:34:48 I want to insert on this format.
I have some attribute is date time on this format "2017-06-23 15:34:48".can and I set that to NSDate. But the value is not inserting on the table can anyone help me I added this object as NSDate
2017-06-23 15:34:48 I want to insert on this format.
My Solution:
NSDateFormatter *df = [[NSDateFormatter alloc] init];
[df setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSDate *myDate = [df dateFromString:@"2017-06-23 15:34:48"];
NSLog(@"%@", myDate);