NAME
Solstice::DateTime::Range - Represents a range in time.
SYNOPSIS
use Solstice::DateTime::Range;
# initialize:
my $range = new Solstice::DateTime::Range( $start_datetime, $end_datetime );
my $range = new Solstice::DateTime::Range();
$range->setStartDateTime( $start_datetime );
$range->setEndDateTime( $end_datetime );
# query!
$range->isValidRange();
$range->isDateTimeBeforeRange( $other_datetime );
$range->isDateTimeAfterRange( $other_datetime );
$range->isDateTimeInRange( $other_datetime );
$range->isNowInRange();
$range->getIntervalString();
$range->toString($format);
DESCRIPTION
Export
No symbols exported.
Methods
- new( [ $start, $end ] )
-
Constructor. Returns a Solstice::DateTime::Range object.
- isValidRange()
-
Returns true if the start and end times are valid and the start time precedes the end
- isDateTimeInRange($date)
-
Returns true if the passed DateTime is within the range
- isDateTimeBeforeRange($date)
-
Returns true if the passed date is before the range
- isDateTimeAfterRange($date)
-
Returns true if the passed date is after the range
- isNowInRange()
-
Returns true if the range encompasses now.
- toString($format)
-
Returns a formated string of the interval. The format should be strftime compatible.
- getIntervalString([$display_years])
-
Returns a formatted string that represents the interval. If passed $display_years, the returned $str will be formatted as YMDHMS, otherwise DHMS.
Private Methods
Modules Used
Solstice::DateTime, Date::Format.
AUTHOR
Catalyst Group, <catalyst@u.washington.edu>
VERSION
$Revision: 3364 $
COPYRIGHT
Copyright 1998-2007 Office of Learning Technologies, University of Washington
Licensed under the Educational Community License, Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.opensource.org/licenses/ecl1.php
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.