Perry Smith

Java Questions & Answers

Archive

Home / Java Q & A Archive Page 4 / Java Q & A Archive / Java Main Page

setting execution times
Tuesday, 02-Mar-99 12:57:58

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


Response
Re: setting execution times
Tuesday, 02-Mar-99 13:40:07

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


Home / Java Q & A Archive Page 4 / Java Q & A Archive / Java Main Page