Randy, On Thu, Apr 05, 2007 at 09:08:45PM -0400, Jim Bacon wrote: > Here's the brute force logic. Doesn't take DST into account and actually > tests for the period of 22:00:00 - 01:59:59. > > my $current = DateTime->now; > return($current->hour < 2 && $current->hour >= 22); ............................^^
you meant to say || there, didn't you? > > -----Original Message----- > > From: Randall Marbach [mailto:[EMAIL PROTECTED] > > Sent: Thursday, April 05, 2007 8:42 PM > > To: datetime@perl.org > > Subject: Puzzled about Just Time > > > > > > I have a simple problem that I cannot seem to find the answer to > > in the DateTime Documentation. > > > > Given a start time of 22:00 hours and a stop time of 02:00 hours, > > I want to create a script that.... > > > > runs every 5 mins, > > gets Datetime->now > > and prints TRUE if the time is between 22:00-02:00 or false otherwise. > > > > It looks like DateTime::Incomplete might have worked but it > > doesnt seem to support durations, yet. > > > > Can anybody out there offer a solution to this puzzle? Cheers -Martin