Uses of Class
java.util.Calendar

Packages that useCalendar
Package
Description
java.sql
Provides the API for accessing and processing data stored in a data source (usually a relational database) using the Java programming language.
java.text
Provides classes and interfaces for handling text, dates, numbers, and messages in a manner independent of natural languages.
java.util
Contains the collections framework, some internationalization support classes, a service loader, properties, random number generation, string parsing and scanning classes, base64 encoding and decoding, a bit array, and several miscellaneous utility classes.
javax.sql
Provides the API for server side data source access and processing from the Java programming language.
javax.sql.rowset
Standard interfaces and base classes for JDBCRowSet implementations.
javax.xml.datatype
Defines XML/Java Type Mappings.
  • Uses ofCalendar injava.sql

    Methods injava.sql with parameters of typeCalendar
    Modifier and Type
    Method
    Description
    CallableStatement.getDate(int parameterIndex,Calendar cal)
    Retrieves the value of the designated JDBCDATE parameter as ajava.sql.Date object, using the givenCalendar object to construct the date.
    CallableStatement.getDate(String parameterName,Calendar cal)
    Retrieves the value of a JDBCDATE parameter as ajava.sql.Date object, using the givenCalendar object to construct the date.
    ResultSet.getDate(int columnIndex,Calendar cal)
    Retrieves the value of the designated column in the current row of thisResultSet object as ajava.sql.Date object in the Java programming language.
    ResultSet.getDate(String columnLabel,Calendar cal)
    Retrieves the value of the designated column in the current row of thisResultSet object as ajava.sql.Date object in the Java programming language.
    CallableStatement.getTime(int parameterIndex,Calendar cal)
    Retrieves the value of the designated JDBCTIME parameter as ajava.sql.Time object, using the givenCalendar object to construct the time.
    CallableStatement.getTime(String parameterName,Calendar cal)
    Retrieves the value of a JDBCTIME parameter as ajava.sql.Time object, using the givenCalendar object to construct the time.
    ResultSet.getTime(int columnIndex,Calendar cal)
    Retrieves the value of the designated column in the current row of thisResultSet object as ajava.sql.Time object in the Java programming language.
    ResultSet.getTime(String columnLabel,Calendar cal)
    Retrieves the value of the designated column in the current row of thisResultSet object as ajava.sql.Time object in the Java programming language.
    CallableStatement.getTimestamp(int parameterIndex,Calendar cal)
    Retrieves the value of the designated JDBCTIMESTAMP parameter as ajava.sql.Timestamp object, using the givenCalendar object to construct theTimestamp object.
    CallableStatement.getTimestamp(String parameterName,Calendar cal)
    Retrieves the value of a JDBCTIMESTAMP parameter as ajava.sql.Timestamp object, using the givenCalendar object to construct theTimestamp object.
    ResultSet.getTimestamp(int columnIndex,Calendar cal)
    Retrieves the value of the designated column in the current row of thisResultSet object as ajava.sql.Timestamp object in the Java programming language.
    ResultSet.getTimestamp(String columnLabel,Calendar cal)
    Retrieves the value of the designated column in the current row of thisResultSet object as ajava.sql.Timestamp object in the Java programming language.
    void
    CallableStatement.setDate(String parameterName,Date x,Calendar cal)
    Sets the designated parameter to the givenjava.sql.Date value, using the givenCalendar object.
    void
    PreparedStatement.setDate(int parameterIndex,Date x,Calendar cal)
    Sets the designated parameter to the givenjava.sql.Date value, using the givenCalendar object.
    void
    CallableStatement.setTime(String parameterName,Time x,Calendar cal)
    Sets the designated parameter to the givenjava.sql.Time value, using the givenCalendar object.
    void
    PreparedStatement.setTime(int parameterIndex,Time x,Calendar cal)
    Sets the designated parameter to the givenjava.sql.Time value, using the givenCalendar object.
    void
    CallableStatement.setTimestamp(String parameterName,Timestamp x,Calendar cal)
    Sets the designated parameter to the givenjava.sql.Timestamp value, using the givenCalendar object.
    void
    PreparedStatement.setTimestamp(int parameterIndex,Timestamp x,Calendar cal)
    Sets the designated parameter to the givenjava.sql.Timestamp value, using the givenCalendar object.
  • Uses ofCalendar injava.text

    Fields injava.text declared asCalendar
    Modifier and Type
    Field
    Description
    protectedCalendar
    DateFormat.calendar
    TheCalendar instance used for calculating the date-time fields and the instant of time.
    Methods injava.text that returnCalendar
    Modifier and Type
    Method
    Description
    DateFormat.getCalendar()
    Gets the calendar associated with this date/time formatter.
    Methods injava.text with parameters of typeCalendar
    Modifier and Type
    Method
    Description
    void
    DateFormat.setCalendar(Calendar newCalendar)
    Set the calendar to be used by this date format.
  • Uses ofCalendar injava.util

    Subclasses ofCalendar injava.util
    Modifier and Type
    Class
    Description
    class 
    GregorianCalendar is a concrete subclass ofCalendar and provides the standard calendar system used by most of the world.
    Classes injava.util that implement interfaces with type arguments of typeCalendar
    Modifier and Type
    Class
    Description
    class 
    TheCalendar class is an abstract class that provides methods for converting between a specific instant in time and a set ofcalendar fields such asYEAR,MONTH,DAY_OF_MONTH,HOUR, and so on, and for manipulating the calendar fields, such as getting the date of the next week.
    Methods injava.util that returnCalendar
    Modifier and Type
    Method
    Description
    Calendar.Builder.build()
    Returns aCalendar built from the parameters set by the setter methods.
    staticCalendar
    Calendar.getInstance()
    Gets a calendar using the default time zone and locale.
    staticCalendar
    Calendar.getInstance(Locale aLocale)
    Gets a calendar using the default time zone and specified locale.
    staticCalendar
    Calendar.getInstance(TimeZone zone)
    Gets a calendar using the specified time zone and default locale.
    staticCalendar
    Calendar.getInstance(TimeZone zone,Locale aLocale)
    Gets a calendar with the specified time zone and locale.
    Methods injava.util with parameters of typeCalendar
    Modifier and Type
    Method
    Description
    int
    Calendar.compareTo(Calendar anotherCalendar)
    Compares the time values (millisecond offsets from theEpoch) represented by twoCalendar objects.
  • Uses ofCalendar injavax.sql

    Methods injavax.sql with parameters of typeCalendar
    Modifier and Type
    Method
    Description
    void
    RowSet.setDate(int parameterIndex,Date x,Calendar cal)
    Sets the designated parameter in thisRowSet object's command with the givenjava.sql.Date value.
    void
    RowSet.setDate(String parameterName,Date x,Calendar cal)
    Sets the designated parameter to the givenjava.sql.Date value, using the givenCalendar object.
    void
    RowSet.setTime(int parameterIndex,Time x,Calendar cal)
    Sets the designated parameter in thisRowSet object's command with the givenjava.sql.Time value.
    void
    RowSet.setTime(String parameterName,Time x,Calendar cal)
    Sets the designated parameter to the givenjava.sql.Time value, using the givenCalendar object.
    void
    RowSet.setTimestamp(int parameterIndex,Timestamp x,Calendar cal)
    Sets the designated parameter in thisRowSet object's command with the givenjava.sql.Timestamp value.
    void
    RowSet.setTimestamp(String parameterName,Timestamp x,Calendar cal)
    Sets the designated parameter to the givenjava.sql.Timestamp value, using the givenCalendar object.
  • Uses ofCalendar injavax.sql.rowset

    Methods injavax.sql.rowset with parameters of typeCalendar
    Modifier and Type
    Method
    Description
    void
    BaseRowSet.setDate(int parameterIndex,Date x,Calendar cal)
    Sets the designated parameter to the givenjava.sql.Date object.
    void
    BaseRowSet.setDate(String parameterName,Date x,Calendar cal)
    Sets the designated parameter to the givenjava.sql.Date value, using the givenCalendar object.
    void
    BaseRowSet.setTime(int parameterIndex,Time x,Calendar cal)
    Sets the designated parameter to the givenjava.sql.Time object.
    void
    BaseRowSet.setTime(String parameterName,Time x,Calendar cal)
    Sets the designated parameter to the givenjava.sql.Time value, using the givenCalendar object.
    void
    BaseRowSet.setTimestamp(int parameterIndex,Timestamp x,Calendar cal)
    Sets the designated parameter to the givenjava.sql.Timestamp object.
    void
    BaseRowSet.setTimestamp(String parameterName,Timestamp x,Calendar cal)
    Sets the designated parameter to the givenjava.sql.Timestamp value, using the givenCalendar object.
  • Uses ofCalendar injavax.xml.datatype

    Methods injavax.xml.datatype with parameters of typeCalendar
    Modifier and Type
    Method
    Description
    abstract void
    Duration.addTo(Calendar calendar)
    Adds this duration to aCalendar object.
    long
    Duration.getTimeInMillis(Calendar startInstant)
    Returns the length of the duration in milli-seconds.
    abstractDuration
    Duration.normalizeWith(Calendar startTimeInstant)
    Converts the years and months fields into the days field by using a specific time instant as the reference point.