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.
Is there a difference between getting a new calendar instance and getting the system time explicitly.
With regards to getting the current.
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());
}
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.
> 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?