問題描述
Calendar.HOUR
和 Calendar.HOUR_OF_DAY
有什么區(qū)別?何時使用 Calendar.HOUR
和 Calendar.HOUR_OF_DAY
?有時我很困惑 Calendar.HOUR
這工作正常,而其他時候 Calendar.HOUR_OF_DAY
這工作正常.他們以 int 的形式返回什么?我已閱讀 this 文檔,但不明白其中的區(qū)別.有什么建議謝謝.
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 = get 和 set 字段編號,指示上午或下午的時間.HOUR 用于 12 小時制.例如,在晚上 10:04:15.250,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 = get 和 set 字段編號,指示一天中的小時.HOUR_OF_DAY 用于 24 小時制.例如,在晚上 10:04:15.250,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.
這篇關(guān)于Calendar.HOUR 和 Calendar.HOUR_OF_DAY 之間的區(qū)別?的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!