Getting Current time - calendar.getInstance() vs System.getTime...

Is there a difference between getting a new calendar instance and getting the system time explicitly.

With regards to getting the current.

[151 byte] By [winderjja] at [2007-11-27 11:57:18]
# 1

No. Calendar.getInstance() eventually leads to this constructor being called

(assuming you are not getting the Thai or Japanese Imperial calendar)

public GregorianCalendar(TimeZone zone, Locale aLocale) {

super(zone, aLocale);

gdate = (BaseCalendar.Date) gcal.newCalendarDate(zone);

setTimeInMillis(System.currentTimeMillis());

}

ParvatiDevia at 2007-7-29 19:13:01 > top of Java-index,Java Essentials,Java Programming...
# 2

Did you ever know that you're my hero?

Thanks for the quick answer ;)

winderjja at 2007-7-29 19:13:01 > top of Java-index,Java Essentials,Java Programming...
# 3

No, but it depends on what format you want. Do you just need a raw number of milliseconds since 1/1/1970 or do you need a Calendar object that you can more easily do manipulations on.

bsampieria at 2007-7-29 19:13:01 > top of Java-index,Java Essentials,Java Programming...
# 4

> Did you ever know that you're my hero?

>

> Thanks for the quick answer ;)

All I did was poke around in the source code.

Hint: have you unzipped it?

ParvatiDevia at 2007-7-29 19:13:01 > top of Java-index,Java Essentials,Java Programming...