in reply to current time between two time

If they're always in the same day you could just convert to minutes.
#!/usr/bin/perl for (qw(9:01PM 3:30AM 1:10AM)) { if (m{^(\d+):(\d\d)(AM|PM)}) { print "$_ is @{[$1*60+$2+($3 eq 'PM' ? 12*60 : 0)]} minutes\n" +; }; };

Replies are listed 'Best First'.
Re^2: current time between two time
by davido (Cardinal) on Mar 04, 2014 at 20:21 UTC

    I think that even his example times are not in the same day. Start time 9:01PM, end time 3:30AM? Either the end time is the next day, or it falls before the start time, which doesn't make much sense.


    Dave

      I still like the approach to just compare minutes. If the end-time is before the start-time, you could always correct it by adding 24 hours.