Hi, In my project, if a customer calls an agent,his time matches with the server time.If the calling time is between 9.00 AM to 6.00 PM the welcome message will be played.If the calling time is between 6.00 PM to 9.00 Am,the message agents logged off should be played.I tried the following.
Here i have checked whether my time 11.49 AM > 9.00 AM and 11.49 AM < 6.00 PM.But nothing is displayed.because it is not taking the AM and PM.It is just comparing 11.49 < 6.00.How can i compare the AM and PM?please help me to solve this.
Originally posted by fred rosenberger: according to the api, you could also do this:
int hour = calendar.get(Calendar.HOUR_OF_DAY);
which uses a 24 hour clock. you could then check for > 9 and < 18
That is better solution.
Moiz Randhikpurwala
Greenhorn
Joined: Apr 30, 2010
Posts: 1
posted
0
Hi how do i extend the logic to support three time zone.. e.g. 2 to 8 i display one message.. 8 to 16 another .. 16 to 24 another messages.. could you please help give n example.
Campbell Ritchie
Sheriff
Joined: Oct 13, 2005
Posts: 32599
4
posted
0
Welcome to the Ranch
Do the documents for DateFormat and its subclasses help? You can put in fields for a timezone.
I agree. Here's the link: http://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to
run our stuff on 16 servers instead of 3.