0

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.
rmaddy
  • 314,917
  • 42
  • 532
  • 579
Manju
  • 27
  • 8

1 Answers1

0

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);
Sargis
  • 1,196
  • 1
  • 18
  • 31