PDA

View Full Version : Is it posible to convert a Calendar to GregorianCalendar in java ?



hoboy
October 20th, 2010, 05:11 PM
I have actually google for this.
is it possible to convert a Calendar to Gregorian calendar using java ?
does any body has an example java code that can do this ?

Some Penguin
October 20th, 2010, 05:23 PM
Usually a Calendar will actually *be* a GregorianCalendar. The former is an abstract base class and the latter is an actual implementation.

Otherwise, create a GregorianCalendar and newGC.setTimeInMillis(oldNonGC.getTimeInMillis()).

hoboy
October 20th, 2010, 05:41 PM
Usually a Calendar will actually *be* a GregorianCalendar. The former is an abstract base class and the latter is an actual implementation.

Otherwise, create a GregorianCalendar and newGC.setTimeInMillis(oldNonGC.getTimeInMillis()).

tks.
you are right.
Calendar local = new GregorianCalendar();
GregorianCalendar locals= new GregorianCalendar();