Calendar.HOUR和Calendar.HOUR_OF_DAY之间的区别? [英] Difference between Calendar.HOUR and Calendar.HOUR_OF_DAY?
问题描述
Calendar.HOUR
和 Calendar.HOUR_OF_DAY
之间有什么区别?
何时使用 Calendar.HOUR
和 Calendar.HOUR_OF_DAY
?
我有时会感到困惑 Calendar.HOUR
这个工作正常,othe cime Calendar.HOUR_OF_DAY
这个工作正常。他们以int的形式返回什么?
我已阅读此文档但未了解其中的差异。
任何建议
谢谢。
What is the difference between Calendar.HOUR
and Calendar.HOUR_OF_DAY
?
When to use Calendar.HOUR
and Calendar.HOUR_OF_DAY
?
I am confused sometime Calendar.HOUR
this works fine and othertime Calendar.HOUR_OF_DAY
this works fine. What they return in the form of int?
I have read this documentation but not understood the difference.
Any suggestions
Thanks.
推荐答案
来自 http://docs.oracle.com/javase/7/docs/api/java/util/Calendar .html#HOUR :
Calendar.HOUR =获取和设置的字段编号,表示上午或下午的小时。小时用于12小时制。例如,在10:04:15.250 PM,HOUR为10.
Calendar.HOUR = Field number for get and set indicating the hour of the morning or afternoon. HOUR is used for the 12-hour clock. E.g., at 10:04:15.250 PM the HOUR is 10.
Calendar.HOUR_OF_DAY =获取和设置的字段编号,表示当天的小时。 HOUR_OF_DAY用于24小时制。例如,在10:04:15.250 PM,HOUR_OF_DAY是22。
Calendar.HOUR_OF_DAY = Field number for get and set indicating the hour of the day. HOUR_OF_DAY is used for the 24-hour clock. E.g., at 10:04:15.250 PM the HOUR_OF_DAY is 22.
这篇关于Calendar.HOUR和Calendar.HOUR_OF_DAY之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!