且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

确定是否为“24 小时制"设置已设置

更新时间:2023-02-22 12:31:04

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

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.