添加AM / PM到datepicker? [英] Add AM/PM to datepicker?

查看:131
本文介绍了添加AM / PM到datepicker?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的UIDatePicker设置为UIDatePickerModeTime,但在苹果文档中,它表示日期选择器显示小时,分钟和(可选)AM / PM指定。显示的确切项目及其顺序取决于区域设置。此模式的示例是[6 | 53 | PM]。。如何添加AM / PM,因为在我的设备上,这些不是选项,它使用24小时的时钟?

My UIDatePicker is set to UIDatePickerModeTime but on the apple documentation it says The date picker displays hours, minutes, and (optionally) an AM/PM designation. The exact items shown and their order depend upon the locale set. An example of this mode is [ 6 | 53 | PM ].. How do i add AM/PM because on my device, those aren't options and it instead uses a 24 hour clock?

推荐答案

这将取决于用户的设置。如果你去设置 - >一般 - >日期&时间。有一个24小时时间开关,并基于用户将有选择器上的AM / PM指示器。

This will depend on the settings of the user. If you go to Settings -> General -> Date & Time. there is a "24-Hour" time switch, and based on that users will have the AM/PM indicator on your picker.

这篇关于添加AM / PM到datepicker?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆