23.11.2017 Views

java_tutorial

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Java<br />

5<br />

GregorianCalendar(Locale aLocale)<br />

Constructs a GregorianCalendar based on the current time in the default time<br />

zone with the given locale.<br />

6<br />

GregorianCalendar(TimeZone zone)<br />

Constructs a GregorianCalendar based on the current time in the given time<br />

zone with the default locale.<br />

7<br />

GregorianCalendar(TimeZone zone, Locale aLocale)<br />

Constructs a GregorianCalendar based on the current time in the given time<br />

zone with the given locale.<br />

Here is the list of few useful support methods provided by GregorianCalendar class:<br />

Sr. No.<br />

Methods with Description<br />

1<br />

void add(int field, int amount)<br />

Adds the specified (signed) amount of time to the given time field, based<br />

on the calendar's rules.<br />

2<br />

protected void computeFields()<br />

Converts UTC as milliseconds to time field values.<br />

3<br />

protected void computeTime()<br />

Overrides Calendar Converts time field values to UTC as milliseconds.<br />

4<br />

boolean equals(Object obj)<br />

Compares this GregorianCalendar to an object reference.<br />

5<br />

int get(int field)<br />

Gets the value for a given time field.<br />

213

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!