JAVA Time Problem: Want to get the current time and perform validation
- From: "The One" <ankitdave@xxxxxxxxx>
- Date: 28 Nov 2006 14:38:37 -0800
Hi,
I am working on a module which has to check the current time. If the
time is within the bounds then the system performs further steps.
I have to use the Eastern std. Time as the base time for the
validation.
Here is the sample code:
TimeZone myTimeZone = TimeZone.getTimeZone("EST");
Calendar calendar = Calendar.getInstance();
int iHour = calendar.get(Calendar.HOUR_OF_DAY);
System.out.print(iHour);
//Time between 8 AM and 8PM EST
if (iHour > 8 & iHour < 20)
{
Go Ahead
}
This code doesn't seem to work correctly.
Can anybody help me out ?
Thanks
Dave
.
- Follow-Ups:
- Re: JAVA Time Problem: Want to get the current time and perform validation
- From: Steve W. Jackson
- Re: JAVA Time Problem: Want to get the current time and perform validation
- From: Daniel Pitts
- Re: JAVA Time Problem: Want to get the current time and perform validation
- Prev by Date: Re: How to parse and manipulate a binary stream
- Next by Date: Re: Newbie String Questions
- Previous by thread: Newbie String Questions
- Next by thread: Re: JAVA Time Problem: Want to get the current time and perform validation
- Index(es):
Relevant Pages
|