Gregorian calendar class

403 views
237 views

Published on

Published in: Education
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
403
On SlideShare
0
From Embeds
0
Number of Embeds
10
Actions
Shares
0
Downloads
6
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Gregorian calendar class

  1. 1. GregorianCalendar Class
  2. 2. New GregorianCalendar () setGregorianChange() New GregorianCalendar (object_locale) getActualMaximum() New GregorianCalendar (year,month,day) getActualMinimum() New GregorianCalendar (year,month,day,minute) isLeapYear()
  3. 3. new GregorianCalendar () Object GregorianCalendar timezone method : new GregorianCalendar (); return type : GregorianCalendar content : Object GregorianCalendar timezone (timezone ) example : GregorianCalendar gregorian_calendar = new GregorianCalendar (); Back
  4. 4. new GregorianCalendar (object_locale) Object GregorianCalendar timezone Locale method : new GregorianCalendar ( object_locale ); return type : GregorianCalendar content : Object GregorianCalendar timezone Locale (Locale = ) example : Locale locale = new Locale ( "th", "TH" ); GregorianCalendar gregorian_calendar = new Back GregorianCalendar ( locale );
  5. 5. new GregorianCalendar(year,mon th,day) GregorianCalendar Object method : new GregorianCalendar ( year, month, day ); return type : GregorianCalendar content : Object GregorianCalendar example : GregorianCalendar gregorian_calendar = new GregorianCalendar ( 2012, 12, 12 ); Back
  6. 6. new GregorianCalendar ( year, month, day, hour, minu te ); Object GregorianCalendar method : new GregorianCalendar ( year, month, day, hour, minute ); return type : GregorianCalendar content : Object GregorianCalendar example : GregorianCalendar gregorian_calendar = new GregorianCalendar ( 2012, 12, 12, 0, 0 ); Back
  7. 7. setGregorianChange() object GregorianCalendar method : setGregorianChange ( object_date ); return type : void content : object GregorianCalendar example : GregorianCalendar gregorian_calendar = new GregorianCalendar ( 2012, 12, 12, 0, 0 ); Date date = new Date (); gregorian_calendar.setGregorianChange ( date ); Back
  8. 8. getActualMaximum() method : getActualMaximum ( calendar_constant ); return type : int content : example : GregorianCalendar gregorian_calendar = new GregorianCalendar ( 2012, 12, 12, 0, 0 ); int max_year = gregorian_calendar.getActualMaximum ( Calendar.YEAR ); int max_month = Back gregorian_calendar.getActualMaximum ( Calendar.MONTH );
  9. 9. getActualMinimum() method : getActualMinimum ( calendar_constant ); return type : int content : example : GregorianCalendar gregorian_calendar = new GregorianCalendar ( 2012, 12, 12, 0, 0 ); int min_year = gregorian_calendar.getActualMinimum ( Calendar.YEAR ); int min_month = Back gregorian_calendar.getActualMinimum ( Calendar.MONTH );
  10. 10. isLeapYear() leap year method : isLeapYear ( year ); return type : boolean content : leap year example : GregorianCalendar gregorian_calendar = new GregorianCalendar (); if ( gregorian_calendar.isLeapYear ( 2009 ) ) { System.out.println ( "2007 is leap year." ); } Back

×