Stuart McLachlan
stuart at lexacorp.com.pg
Thu Feb 12 20:20:30 CST 2004
On 12 Feb 2004 at 21:09, John W. Colby wrote: > I need to be able to express a pure time window (not date related) from / to > and test time() as being between (inside) this time window. This process > doesn't work across midnight, i.e. 7:00 pm is "between" 6:00 pm and 1:00 am. > However if I just do a simple compare - 7:00 PM is >= 6:00 PM but it is not > <= 1:00 am. > > It looks like a "if time 2 > time 1 then use simple test for time()" "If > Time 2 < time 1 then invert the second time comparison" > > Has anyone done this already? > Since times are actually stored as date/times with an integer part of 0, you can just use: If time2 < time1 then time2 = time2 + 1 -- Lexacorp Ltd http://www.lexacorp.com.pg Information Technology Consultancy, Software Development,System Support.