Here is my code:

```
NSDate *currentdate = [[NSDate alloc] init];
NSDateFormatter *df = [[NSDateFormatter alloc] init];
[df setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
NSDate *selectedDate = [df dateFromString:SelectedDate];

```

this gives proper date in iOS8 but in iOS9 giving `nil` date Please help. thank you.