NSDateFormatter* formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@\"dd-MM-YYYY HH:mm\"];
[formatter setTimeZone:[NSTimeZone syst
This is a stripped down solution that works with Swift 4 in producing a 3 letter month output:
let dateFormatter = DateFormatter()
dateFormatter.dateFormat = "dd MMM YYYY, HH:mm:ss"
And to verify:
print(dateFormatter.string(from: Date())) // 20 Mar 2018, 23:41:40
As previously noted, MMM
is the correct syntax for getting the desired month output.