Change the date format of date picker
<p>I would like to change the format of like the image attached </p>

<p><img src="https://i.stack.imgur.com/v5Cjd.png" alt="date view picker"></p>

<p>from YYYY/MM/DD to dd/MMM hh:min a but unfortunately i cannot do that</p>

<p>Here is my work in view controller 3</p>

<pre><code>#import "ViewController3.h"

@interface ViewController3 ()

@end

@implementation ViewController3

@synthesize text;

- (void)viewDidLoad {
    [super viewDidLoad];

    datePicker=[[UIDatePicker alloc]init];
    datePicker.datePickerMode=UIDatePickerModeDate;
    [self.text setInputView:datePicker];
    UIToolbar *toolBar=[[UIToolbar alloc]initWithFrame:CGRectMake(0, 0, 320, 44)];
    [toolBar setTintColor:[UIColor grayColor]];
    UIBarButtonItem *doneBtn=[[UIBarButtonItem alloc]initWithTitle:@"Done" style:UIBarButtonItemStyleBordered target:self action:@selector(ShowSelectedDate)];
    UIBarButtonItem *space=[[UIBarButtonItem alloc]initWithBarButtonSystemItem:UIBarButtonSystemItemFlexibleSpace target:nil action:nil];
    [toolBar setItems:[NSArray arrayWithObjects:space,doneBtn, nil]];
    [self.text setInputAccessoryView:toolBar];

}

-(void)ShowSelectedDate
{   NSDateFormatter *formatter=[[NSDateFormatter alloc]init];
    [formatter setDateFormat:@"dd/MMM hh:min a"];
    self.text.text=[NSString stringWithFormat:@"%@",[formatter stringFromDate:datePicker.date]];
    [self.text resignFirstResponder];
}
    @end
</code></pre>

<p>Do you have any other idea?</p>