• Post Reply Bookmark Topic Watch Topic
  • New Topic

Slightly confused about Calendar Object  RSS feed

 
O. Ziggy
Ranch Hand
Posts: 430
Android Debian VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Slightly confused about Calendar Object

This bit of code is supposed to check whether a certain point in time (lastRefresh) is before now.
note: lastRefresh is the result of a new java.util.Date() that was initialised earler.





The lastRefreshCal.setTime(lastRefresh); line sets the calendar object and initialises it with a time that is a date object that was initialised earlier today.

What i dont understand is why is it setting the times(HOUR,MILISECOND,MINUTE,SECOND) for both lastRefreshCal and today after it has set the time via setTime()? is this not comparing 0.0.0.0 with 0.0.0.0?
 
O. Ziggy
Ranch Hand
Posts: 430
Android Debian VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry guys i found what i was doing wrong.

The days are not set so it is comparing the days and ignoring the time.
 
Darryl Burke
Bartender
Posts: 5167
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
[posted content removed]

Just another cross poster.
http://forums.sun.com/thread.jspa?threadID=5344906
[ November 04, 2008: Message edited by: Darryl Burke ]
 
Campbell Ritchie
Marshal
Posts: 56593
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Darryl Burke is right: peole on both websites ought to know if you post twice: read this FAQ.
 
O. Ziggy
Ranch Hand
Posts: 430
Android Debian VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didnt realise that this was an issue. Wouldnt posting on multiple sites increase the chance of getting a varied response?

I thought crossposting was when you post on multiple forums on the same sites. I dont really see how it is a problem if the sites are completely unrelated.

Having said that, i didnt realise that this was a policy on this site. I will try and do that from now on.

Do i have to mention where on the internet i have made a similar post?
[ November 04, 2008: Message edited by: O. Ziggy ]
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I didnt realise that this was an issue. Wouldnt posting on multiple sites increase the chance of getting a varied response?


Well, it isn't a *major* issue. The problem with crossposting (even with different sites) is that you are wasting people time and effort. You can think of it as "getting a varied response", but what happens if the response is the same, just worded differently?


Anyway, IMO, it isn't a major issue, and most of the moderators don't even bother with it at all. Personally, it doesn't bother me at all... but as you can tell, it is an issue with some users. And most likely, it is because they wasted time answering questions in the past.

Henry
 
O. Ziggy
Ranch Hand
Posts: 430
Android Debian VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you look at the second post on this thread, I replied to the thread to mention that i had found the answer. I did this because the question was solved on the other site. I didnt just ignore the thread after finding out the answer.

As i mentioned on the other site, i dont really have any problem mentioning that i have posted on other sites even though i dont agree with it as the sites are unrelated.

As i am the one looking for help it would only make sense to oblige
[ November 04, 2008: Message edited by: O. Ziggy ]
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!