Java-Updating Calendar

Updating Calendar The set( ) method is used to sets the values for the fields YEAR, MONTH, DAY_OF_MONTH, HOUR, MINUTE, and SECOND. Program Program Source import java.util.Calendar; public class Javaapp { public static void main(String[] args) { Calendar caldr = Calendar.getInstance(); int year = 2000; int month = 5; int dayOfMonth = 6; int hour = 12; int minute = 45; … Read more…

Java-Calendar

Calendar The abstract Calendar class provides a set of methods that allows you to convert a time in milliseconds to a number of useful components. Some examples of the type of information that can be provided are year, month, day, hour, minute, and second. The getInstance( ) method is used to get the calender object for … Read more…

Java-Get Date Properties

Get Date Properties Date defines many methods that obtain the standard properties of a Date object. For example, getYear( ) method returns the year represented by this date since 1900, getMonth( ) method returns the month represented by this date, getDate( ) method returns the day of the month represented by this date, getHour( ) … Read more…

Java-Date

Date The date and time are encapsulate as objects inside the Date class. It allows date object to be accessed in a system independent manner. The toLocaleString( ) method returns a string representation of this date, using the locale conventions. The toGMTString( ) method returns a string representation of this date, using the Internet GMT conventions. Program … Read more…