确定" 24小时制"设置被设置 [英] determine if "24-hour clock" setting is set

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

问题描述

什么是确定用户是否设置了24小时制在Windows Phone上的设置,日期+时间设置为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天全站免登陆