wood burning stoves 2.0*
The moose likes Beginning Java and the fly likes Is Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Is "12:59 AM" .LT. "01:00 AM"?" Watch "Is "12:59 AM" .LT. "01:00 AM"?" New topic
Author

Is "12:59 AM" .LT. "01:00 AM"?

Guennadiy VANIN
Ranch Hand

Joined: Aug 30, 2001
Posts: 898
where ".LT." means immediately before.
I just need to sinchronize watches of server and client and I couldn't find this information.
I tried rolling watches of MS Windows but it does not give any answer since changes of min, hrs, sec, PM/AM happen independently
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Yes. (Where "immediately before" means "one minute before".) Usually it's easiest in Java to convert all times to java.util.Date objects, which con handle most comparisons like this for you.


"I'm not back." - Bill Harding, Twister
Dave Vick
Ranch Hand

Joined: May 10, 2001
Posts: 3244
So the question is:
Is "12:59 AM" immediately before "01:00 AM"?
The answer is yes. Keep in mind thought that alot of stuff is kept track of in milliseconds behind the scenes.


Dave
Jim Yingst
Wanderer
Sheriff

Joined: Jan 30, 2000
Posts: 18671
Ah, Dave - if only we'd both posted ten minutes later. (Or 12:10 later I suppose.)
Guennadiy VANIN
Ranch Hand

Joined: Aug 30, 2001
Posts: 898
Thanks guys,
since before is the relative notion, I have used "immediately" while I really mean at the same date (but I was not interested to overburden me with dates also).
I know that time is indivisable even inside finite range
[ January 04, 2003: Message edited by: G Vanin ]
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9044
    
  10
When you looked at the Date class, did you notice the method getTime() ?


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Guennadiy VANIN
Ranch Hand

Joined: Aug 30, 2001
Posts: 898
Yes, certainly.
There are even methods for comparisons and even between different time zones over the internet, etc.
Programmers also need to understand some intricacies...
I just try avoiding posting meaningless (in MD). But the question was about time conventions, not Java. Though it is addressed by JAVA and even caused very big troubles at some time by some versions
... thanks again
[ January 11, 2003: Message edited by: yidanneuG ninaV ]
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Is this a Java question or another complaint about the Book Promotion?


"JavaRanch, where the deer and the Certified play" - David O'Meara
Guennadiy VANIN
Ranch Hand

Joined: Aug 30, 2001
Posts: 898
I deleted my phrase about Book Promotion.
It is not neither Java nor Book Promotion nor Meaningless question. It is interdisciplinary (ubiquitous). If you know, you know (if you don't, you go to JR)
[ January 11, 2003: Message edited by: yidanneuG ninaV ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is "12:59 AM" .LT. "01:00 AM"?
 
Similar Threads
Happy New Year! Welcome to our new forums!
Became SCJP1.6 in Hurry
Constructing prepareStatement efficiently
two questions from K&B Book, SELF-TESTS, Chapter 2
can you fix "my posts" please