0

[Closed]getting next date and time considering specified time range(in hours) [closed]

asked 2012-11-27 11:34:31 +0800

zknl gravatar image zknl
124 2

updated 2013-05-22 11:32:38 +0800

hello ZK professionals,

             I am developing a module where i needs to calculate next date and time after some time interval(after some hours)

i am nearer to output.now i have just calculated next date and time after some time for e.g. date is 27/11/2012 and time is 9.00 am

then i got next date and time after 5 hours as 27/11/2012 , 2.00 pm after 2nd time say 6 hours will be 27/11/2012 , 8.00pm this output came by considering 24 hour time period ( as supported by calender class)

but in my module time period is from 9am to 6pm so that above output should come as after 5 hours as 27/11/2012 , 2.00 pm after 2nd time say 6 hours will be 28/11/2012 , 11.00pm

so how to get this output...i have tried for daterange but i failed in that.

so please help me...its urgent work assigned to me

Thanks in advance

delete flag offensive retag edit

The question has been closed for the following reason "the question is answered, right answer was accepted" by sjoshi
close date 2013-05-22 11:38:56

1 Answer

Sort by ยป oldest newest most voted
0

answered 2012-12-08 10:18:16 +0800

zknl gravatar image zknl
124 2

well i got my que ans.....
i used calender class n its functions to get next date n time...n some logic to get it in between 9am to 6pm range...

in between i was having 1 more query regarding sunday....
that problem also i have solved..but now without considering sunday i get next date with its time,,,,but the value of AM / PM goes wrong...

if anybody is having idea why m going wrong.plz let me know about it..

Thanks in advance
Regards
Nil

link publish delete flag offensive edit

Question tools

Follow

RSS

Stats

Asked: 2012-11-27 11:34:31 +0800

Seen: 64 times

Last updated: May 22 '13

Support Options
  • Email Support
  • Training
  • Consulting
  • Outsourcing
Learn More