Solstice::DateTime::Range - Represents a range in time.


Solstice documentation  | view source Contained in the Solstice distribution.

Index


NAME

Top

Solstice::DateTime::Range - Represents a range in time.

SYNOPSIS

Top

  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

Top

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

_getAccessorDefinition()

Modules Used

Solstice::DateTime, Date::Format.

AUTHOR

Top

Catalyst Group, <catalyst@u.washington.edu>

VERSION

Top

$Revision: 3364 $

COPYRIGHT

Top


Solstice documentation  | view source Contained in the Solstice distribution.