calendar.html

来自「j2se5-api-zh,java文档的中文版本」· HTML 代码 · 共 1,200 行 · 第 1/5 页

HTML
1,200
字号
<TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#get(int)">get</A></B>(int&nbsp;field)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回给定日历字段的值。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#getActualMaximum(int)">getActualMaximum</A></B>(int&nbsp;field)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;给定此 <code>Calendar</code> 的时间值,返回指定日历字段可能拥有的最大值。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#getActualMinimum(int)">getActualMinimum</A></B>(int&nbsp;field)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;给定此 <code>Calendar</code> 的时间值,返回指定日历字段可能拥有的最小值。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="Locale.html" title="java.util 中的类">Locale</A>[]</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#getAvailableLocales()">getAvailableLocales</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回所有语言环境的数组,此类的 <code>getInstance</code> 方法可以为其返回本地化的实例。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#getFirstDayOfWeek()">getFirstDayOfWeek</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;获得一星期的第一天;例如,在美国,这一天是 <code>SUNDAY</code>,而在法国,这一天是 <code>MONDAY</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#getGreatestMinimum(int)">getGreatestMinimum</A></B>(int&nbsp;field)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回此 <code>Calendar</code> 实例给定日历字段的最高的最小值。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="Calendar.html" title="java.util 中的类">Calendar</A></CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#getInstance()">getInstance</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;使用默认时区和语言环境获得一个日历。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="Calendar.html" title="java.util 中的类">Calendar</A></CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#getInstance(java.util.Locale)">getInstance</A></B>(<A HREF="Locale.html" title="java.util 中的类">Locale</A>&nbsp;aLocale)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;使用默认时区和指定语言环境获得一个日历。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="Calendar.html" title="java.util 中的类">Calendar</A></CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#getInstance(java.util.TimeZone)">getInstance</A></B>(<A HREF="TimeZone.html" title="java.util 中的类">TimeZone</A>&nbsp;zone)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;使用指定时区和默认语言环境获得一个日历。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>static&nbsp;<A HREF="Calendar.html" title="java.util 中的类">Calendar</A></CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#getInstance(java.util.TimeZone, java.util.Locale)">getInstance</A></B>(<A HREF="TimeZone.html" title="java.util 中的类">TimeZone</A>&nbsp;zone,            <A HREF="Locale.html" title="java.util 中的类">Locale</A>&nbsp;aLocale)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;使用指定时区和语言环境获得一个日历。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#getLeastMaximum(int)">getLeastMaximum</A></B>(int&nbsp;field)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回此 <code>Calendar</code> 实例给定日历字段的最低的最大值。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#getMaximum(int)">getMaximum</A></B>(int&nbsp;field)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回此 <code>Calendar</code> 实例给定日历字段的最大值。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#getMinimalDaysInFirstWeek()">getMinimalDaysInFirstWeek</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;获得一年中第一个星期所需的最少天数,例如,如果定义第一个星期包含一年第一个月的第一天,则此方法将返回 1。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#getMinimum(int)">getMinimum</A></B>(int&nbsp;field)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回此 <code>Calendar</code> 实例给定日历字段的最小值。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="Date.html" title="java.util 中的类">Date</A></CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#getTime()">getTime</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回一个表示此 <code>Calendar</code> 时间值(从<a href="#Epoch">历元</a>至现在的毫秒偏移量)的 <code>Date</code> 对象。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;long</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#getTimeInMillis()">getTimeInMillis</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回此 Calendar 的时间值,以毫秒为单位。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;<A HREF="TimeZone.html" title="java.util 中的类">TimeZone</A></CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#getTimeZone()">getTimeZone</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;获得时区。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#hashCode()">hashCode</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回该此日历的哈希代码。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>protected &nbsp;int</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#internalGet(int)">internalGet</A></B>(int&nbsp;field)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;返回给定日历字段的值。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#isLenient()">isLenient</A></B>()</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;判断日期/时间的解释是否为宽松的。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;boolean</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#isSet(int)">isSet</A></B>(int&nbsp;field)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;确定给定日历字段是否已经设置了一个值,其中包括因为调用 <code>get</code> 方法触发内部字段计算而导致已经设置该值的情况。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>abstract &nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#roll(int, boolean)">roll</A></B>(int&nbsp;field,     boolean&nbsp;up)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;在给定的时间字段上添加或减去(上/下)单个时间单元,不更改更大的字段。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#roll(int, int)">roll</A></B>(int&nbsp;field,     int&nbsp;amount)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;向指定日历字段添加指定(有符号的)时间量,不更改更大的字段。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#set(int, int)">set</A></B>(int&nbsp;field,    int&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;将给定的日历字段设置为给定值。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#set(int, int, int)">set</A></B>(int&nbsp;year,    int&nbsp;month,    int&nbsp;date)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;设置日历字段 <code>YEAR</code>、<code>MONTH</code> 和 <code>DAY_OF_MONTH</code> 的值。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#set(int, int, int, int, int)">set</A></B>(int&nbsp;year,    int&nbsp;month,    int&nbsp;date,    int&nbsp;hourOfDay,    int&nbsp;minute)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;设置日历字段 <code>YEAR</code>、<code>MONTH</code>、<code>DAY_OF_MONTH</code>、<code>HOUR_OF_DAY</code> 和 <code>MINUTE</code> 的值。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#set(int, int, int, int, int, int)">set</A></B>(int&nbsp;year,    int&nbsp;month,    int&nbsp;date,    int&nbsp;hourOfDay,    int&nbsp;minute,    int&nbsp;second)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;设置字段 <code>YEAR</code>、<code>MONTH</code>、<code>DAY_OF_MONTH</code>、<code>HOUR</code>、<code>MINUTE</code> 和 <code>SECOND</code> 的值。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1"><CODE>&nbsp;void</CODE></FONT></TD><TD><CODE><B><A HREF="Calendar.html#setFirstDayOfWeek(int)">setFirstDayOfWeek</A></B>(int&nbsp;value)</CODE><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;设置一星期的第一天是哪一天;例如,在美国,这一天是 <code>SUNDAY</code>,而在法国,这一天是 <code>MONDAY</code>。</TD></TR><TR BGCOLOR="white" CLASS="TableRowColor"><TD ALIGN="right" VALIGN="top" WIDTH="1%"><FONT SIZE="-1">

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?