Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Comparing time
by izut (Chaplain) on Apr 18, 2006 at 15:59 UTC

    Would help if we could see your code. You can check Date::Calc, Date::Manip and DateTime for date and time calculations.

    Igor 'izut' Sutton
    your code, your rules.

Re: Comparing time
by Herkum (Parson) on Apr 18, 2006 at 17:20 UTC

    In your SQL statement have you considered using the BETWEEN comparision?

    SELECT * FROM calendar WHERE now() BETWEEN starttime AND endtime;

    I am not sure that this is the correct syntax, but it should give an idea of how to accomplish what you are asking.

Re: Comparing time
by ptum (Priest) on Apr 18, 2006 at 16:03 UTC

    Alternatively, many databases offer time/date functions which may be of use to you ... we might be able to be more specific if you told us which database ... ?


    No good deed goes unpunished. -- (attributed to) Oscar Wilde
      The database is SQL SERVER.