Hello,
I must make comparisons of dates, but it becomes more difficult when I want to change the TimeZone. I hope that people a little more experienced in this area will address this thorny problem. Here is my code, just go through it.
Code:
Calendar c1 = Calendar.getInstance(TZ1);
c1.set(_year, _MONTH, _DAY, _HOUR, _minute, Seconds);
Date d1 = c1.getTime();
Calendar c2 = Calendar.getInstance(TZ2);
c2.set(_year, _MONTH, _DAY, _HOUR, _minute, Seconds);
Date date2 = c2.getTime();
System.out.System.out.println("1 - d1" + Date1 + "(Calendar.HOUR" + Cal1.get(Calendar.HOUR_OF_DAY) + " - " + Cal1.getTimeInMillis() + ")");
System.out.System.out.println("2 - date2" + Date2 + "(Calendar.HOUR" + c2.get(Calendar.HOUR_OF_DAY) + " - " + c2.getTimeInMillis() + ")");
System.out.System.out.println("3 - Comparison: + (d1.getTime() == Date2.getTime()) + "-> Wait: false");
System.out.System.out.println("4 - TimeZone:" + Cal1.getTimezone().getDisplayName() + "And" + c2.getTimezone().getDisplayName());
I have no idea how it is not working for me. I want to know how to manage the date and the time in the OOP's. If you have any ideas or any documentation on this then please do post back.
Bookmarks