Re: Calendar Issue



Hi Guys ,

What i Did is ,

//Method To Get Today Calendar
public static Calendar getCalendar(Calendar calendar) {

Calendar todaycalendar=(Calendar)calendar;
todaycalendar.set(Calendar.DATE,todaycalendar.getTime().getDate());
todaycalendar.set(Calendar.AM_PM,Calendar.PM);
todaycalendar.set(Calendar.HOUR,00);
todaycalendar.set(Calendar.MINUTE,00);
todaycalendar.set(Calendar.SECOND,00);
return todaycalendar;
}

when calling this method ,

Calendar todayCalendar = HelperClass.getCalendar(Calendar.getInstance
());


so that i would use only one Calendar instance. at least i can cut one
more instance.

thank u.
suugest me if we modify this any more
.



Relevant Pages

  • Re: Calendar Issue
    ... //Method To Get Today Calendar ... public static Calendar getCalendar{ ... This cast casts a Calendar to a Calendar. ... It also points 'todaycalendar' to the same object as 'calendar'. ...
    (comp.lang.java.programmer)
  • Re: ResultSets getDate() -- Date is deprecated
    ... The 'right' way to do things is to create a new Calendar instance from ... And then use the accessors available on Calendar to get your values. ... Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org ...
    (comp.lang.java.databases)
  • Re: Possible bug in Calendar
    ... a Calendar instance based on time, then it seems as a very relevant ... by telling you to read the documentation instead of posting silly ... for the classes/methods you think contain a bug. ... Calendar is an abstract class. ...
    (comp.lang.java.programmer)