Calendar.HOUR 和 Calendar.HOUR_OF_DAY 有什么区别?何时使用 Calendar.HOUR 和 Calendar.HOUR_OF_DAY ?有时我很困惑 Calendar.HOUR 这工作正常,而其他时候 Calendar.HOUR_OF_DAY 这工作正常.他们以 int 的形式返回什么?我已阅读 this 文档,但不明白其中的区别.有什么建议谢谢.
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.
这篇关于Calendar.HOUR 和 Calendar.HOUR_OF_DAY 之间的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
解析 ISO 8601 字符串本地日期时间,就像在 UTC 中Parsing an ISO 8601 string local date-time as if in UTC(解析 ISO 8601 字符串本地日期时间,就像在 UTC 中一样)
如何将公历字符串转换为公历?How to convert Gregorian string to Gregorian Calendar?(如何将公历字符串转换为公历?)
Java:GregorianCalendar 的最大值和最小值是什么/在哪Java: What/where are the maximum and minimum values of a GregorianCalendar?(Java:GregorianCalendar 的最大值和最小值是什么/在哪里?)
1582 年 10 月 15 日之前日期的日历到日期转换.公历Calendar to Date conversion for dates before 15 Oct 1582. Gregorian to Julian calendar switch(1582 年 10 月 15 日之前日期的日历到日期转换
java日历setFirstDayOfWeek不起作用java Calendar setFirstDayOfWeek not working(java日历setFirstDayOfWeek不起作用)
Java:获取当前星期几的值Java: getting current Day of the Week value(Java:获取当前星期几的值)