com>, Fri, 5 Sep 2008 19:11:44, Dr_KralNOSPAM@nyc.rr.com
>Get the current hour and minute (as you said) and calculate
>60*hour+minutes. Compare that to the start and end times in minutes past
>previous midnight (=0).
D = new Date()
X = 100*D.getHours() + D.getMinutes()
OK = X > 0900 && X < 1300
There is no need for the limitation to 60 minutes in every hour! This
form allows times to be entered as normal un-separated 24-hour clock
figures. It assumes that the OP's "between" means "between"; possibly
one or other bound should really be inclusive.
On the Web, users are not necessarily local, and it may be better to
work in UTC.
Using AM & PM in data processing is sheer folly.
It's a good idea to read the newsgroup c.l.j and its FAQ. See below.
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk IE7 FF2 Op9 Sf3
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links.