208.16.89.120 writes:
I'm trying to get up to speed with Java, so I've been creating some practice programs. Right now I'm trying to use an "if" statement to perform a certain action if it is a certain time of day (or later). For example, if the time is 12 noon or later, feed the birds. I can't seem to find a good way of doing this, though. Are there date and time manipulators in Java similar to those in "time.h" (C language)? Thanks!
Gayle
148.5.110.71 writes:
Yes, use the Calendar class. With it you can instantiate an object for the current date/time and use the before and/or after methods to compare it to another Calendar object.
Scott_M2