我试图根据用户的设置获取格式化的日期(年、月、日)和时间(小时、分钟、秒)字符串。ThisAndroidDevelopersGoogleGroup中的帖子描述了我遇到的确切问题,但没有人帮助那个人解决它。我总结一下:Android有这些尝试执行上述操作的类,但没有一个类同时使用用户首选项和显示秒数。java.text.DateFormat不使用在“设置”应用中设置的首选项android.text.format.DateFormat获取一个java.text.DateFormat对象,该对象使用getDateFormat()和getTimeFormat()正确格式化输出,但getTime