Stephane Legault wrote:
> Hi, I want to know id there is a module to valide if
> current time is between tow time value.
> Here example:
> it's now 13:00:00 and it's between 11:00 and 22:00
> it's now 00:00:00 and it's between 23:00:00 and
> 2:00:00
> 
> I'am not new to perl but new to dealing with date and time.

The simplest way is to convert to epoch time and do a simple
compare between the 3 times as already described:

        if ($e1 <= $e3 and $e1 >= $e2) {

or some such.  See gettimeofday and Time::Local:timelocal/timegm
for aid in your epoch time conversion.

It would be nice to know what inputs you have and in what
form they are in.

_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to