| Forums.Sureshkumar.net : A Perfect Place to Share Knowledge Blogs Games Magazines |
|
|
#1 (permalink) |
|
Member
Join Date: Feb 2006
Location: India
Posts: 89
Thanks: 0 Thanked 1 Times in 1 Posts Thanks: 0
Thanked 1 Time in 1 Post
Rep Power: 3
|
calendar problem
hi friend
i want to have two calendar in the same problem,i want to perform different action on both the calendar,and it should't affect each other. i am trying to use folllowing code Calendar calendar = new GregorianCalendar(); Calendar calendar1 = new GregorianCalendar(); to create two calendar,and i am performing different action but its effecting each other,how to avoid it please reply |
|
|
|
|
|
#2 (permalink) |
|
Member
Join Date: Nov 2006
Posts: 56
Thanks: 13 Thanked 3 Times in 3 Posts Thanks: 13
Thanked 3 Times in 3 Posts
Rep Power: 3
|
Re: calendar problem
Hi
Could you please paste the code, where the references are exactly affecting each other, so that it gets easy to find a solution ? |
|
|
|
|
|
#3 (permalink) |
|
Member
Join Date: Nov 2006
Posts: 56
Thanks: 13 Thanked 3 Times in 3 Posts Thanks: 13
Thanked 3 Times in 3 Posts
Rep Power: 3
|
Re: calendar problem
I made this test and the instances seems to work independently...
code: -------------------------------------------------------------------------------- public class CalendarTest { public static void main(String[] args) { SimpleDateFormat sdf = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss"); Calendar cal1 = new GregorianCalendar(2005, 01, 01); Calendar cal2 = new GregorianCalendar(2006, 01, 01); System.out.println("sdf.format(cal1.getTime()): " + sdf.format(cal1.getTime())); System.out.println("sdf.format(cal2.getTime()): " + sdf.format(cal2.getTime())); cal1.add(Calendar.MONTH, 2); System.out.println("After add 2 months to cal1"); System.out.println("sdf.format(cal1.getTime()): " + sdf.format(cal1.getTime())); System.out.println("sdf.format(cal2.getTime()): " + sdf.format(cal2.getTime())); }} -------------------------------------------------------------------------------- |
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| calendar problem | qaisar | JAVA Technologies | 5 | 01-12-06 04:55 PM |
| problem with textbox in ms.net2005(very urgent) | bandiprasad | VB / ASP.NET Technologies | 3 | 22-11-06 07:50 PM |
| Simple solution to a complex problem | AjayKumar.Kataram | Inspire yourself & Others - Leaders Zone | 3 | 10-10-06 12:30 PM |
| System Problem | au123 | NETWORK ADMINISTRATION , HARDWARE & TROUBLESHOOTING | 4 | 09-10-06 10:59 PM |
| Google Calendar ! | BINNY | Latest Tech News & Innovations | 3 | 27-04-06 01:27 AM |