确定是否为“24 小时制"设置已设置 [英] determine if "24-hour clock" setting is set

查看:22
本文介绍了确定是否为“24 小时制"设置已设置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

确定用户是否在 Windows Phone 的设置-日期+时间"中将24 小时制"设置为 true 的最佳方法是什么?

What's the best way to determine if the user has set the "24-hour clock" setting to true in Settings-Date+Time on the Windows Phone ?

我可以通过 CurrentCulture (CultureInfo) 获取此信息吗?我没有找到它.

Can I get this information through the CurrentCulture (CultureInfo) ? I had no luck in finding it.

推荐答案

可以使用以下方法检索系统时钟类型:

The system clock type can be retrieved using:

string clockType = Windows.System.UserProfile.GlobalizationPreferences.Clocks.FirstOrDefault();

这将返回字符串 24HourClock 如果 24 小时设置在设备设置中打开或 12HourClock 如果设置关闭.

This will return the string 24HourClock if the 24 hour setting is on in the device settings or 12HourClock if the setting is off.

这篇关于确定是否为“24 小时制"设置已设置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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