如何在Swift语言中将Gregorian datepicker转换为波斯语日期选择器?
func datePickerValueChanged(sender: UIDatePicker) {
let dateFormatter = NSDateFormatter()
dateFormatter.dateStyle = NSDateFormatterStyle.MediumStyle
dateFormatter.timeStyle = NSDateFormatterStyle.NoStyle
dateFormatter.dateFormat = NSCalendarIdentifierPersian
dateOutlet.text = dateFormatter.stringFromDate(sender.date)
}
Run Code Online (Sandbox Code Playgroud)
我更改了日期格式,NSCalendarIdentifierPersian但datepicker没有任何变化?
如何在Xcode中将波斯日期转换为格里高利日期?
请注意,我想转换我的波斯日期,并在ULAlert视图中获取格里高利日期结果,而不是在NSLog中PLZ告诉我如何