JAVA Time Problem: Want to get the current time and perform validation



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

.



Relevant Pages

  • Re: How do I do this?
    ... If you're trying to do the validation in VBA, here's some sample code ... dropdown box on that cell. ...
    (microsoft.public.excel.programming)
  • Re: Validating data pasted into worksheet
    ... Do you have any sample code? ... "Dave Peterson" wrote: ... >> and the data is exported into a flat file. ... I need field length validation on some ...
    (microsoft.public.excel.misc)
  • Re: object disconnected from client ...
    ... It didn't change anything: Same error message. ... method of a validation object does only delete the validation ... fact that I'm referring to merged cells. ... Here's a little sample code: ...
    (microsoft.public.excel.programming)
  • Access 2003 Date validation on a form
    ... I am looking for some code / example to perform date validation on a ... Has anybody got same sample code on how todo this on a ... Ward. ...
    (microsoft.public.access.forms)
  • Access 2003 Date validation on a form
    ... I am looking for some code / example to perform date validation on a ... Has anybody got same sample code on how todo this on a ... Ward. ...
    (microsoft.public.access.formscoding)