Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Eval a time of day using equals()

 
Reggie McDougal
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can some one give me a hand with my code the below always returns false when the strings currentTime and RUNTIME are equal.




Can some one give me a hand
[ December 05, 2004: Message edited by: Reggie McDougal ]
 
Sainath Veepuri
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Reggie,

Originally posted by Reggie McDougal:
Can some one give me a hand with my code the below always returns false when the strings currentTime and RUNTIME are equal.






If it is the 5th minute in that hour then c.get(Calendar.MINUTE)is returning 5 instead of 05, hence it always would return false.
Just remove '0' from '05' and check it accordingly. It works fine!
 
rastas biggs
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
But it was doing it on 7:22:00 as well which tells me that its not evaluating
 
Sainath Veepuri
Ranch Hand
Posts: 49
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
I answered according to the data in your question.
Any ways, it would only return false if the two strings are not equal.
So why don't you print the two strings and check if they are really equal or not.

- Sai
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic