Link to home
Start Free TrialLog in
Avatar of Jay Roy
Jay RoyFlag for United States of America

asked on

capturing program time

Hi guys
Is there a way in java to see what time of the day my program runs
For example my java program runs at 12Am, 7am, 6pm monday to saturday
through autosys scheduling tool.
So I need to have something like
If(java program is running at 12am){
// do something
}else if(java program is running at 7am){
//Do something else
}

What would be the best way to do this?
Any ideas would be greatly appreciated.
 Thanks.
ASKER CERTIFIED SOLUTION
Avatar of dpearson
dpearson

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Jay Roy

ASKER

thanks
so just to confirm , if its running at 12 AM, the condition should be
if(hours > 23 && hours < 1), correct ?
Avatar of dpearson
dpearson

Yes - that would be the test for midnight (within an hour).

Doug