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); > -----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? > > TIA > > Randy from Burbank > > > > > > > __________________________________________________________________ > __________________ > Never miss an email again! > Yahoo! Toolbar alerts you the instant new Mail arrives. > http://tools.search.yahoo.com/toolbar/features/mail/ >