GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  DATE::HANDLER::RANGE (3)

.ds Aq ’

NAME

Date::Handler::Range - Time range object

CONTENTS

SYNOPSIS



  use Date::Handler::Range;

   my $range = new Date::Handler::Range( { date => $date, delta => $delta);

   $range->new                                          Constructor    
   $range->StartDate()                                  Returns a Date::Handler object of the ranges start date.
   $range->EndDate()                                    Returns a Date::Handler object of the ranges end date.
   $range->Overlaps($range2)                            Returns true if $range overlaps $range2
   $range->Direction(FORWARDS || BACKWARDS)         Sets the direction of the range
   $range->Delta()                                      Returns the delta contained by this range.
   $range->Date()                                       Returns the date contained by this range.



DESCRIPTION

Range objects are used to specify moments in time between 2 dates. For the moment, this functionnality is very primitive but will evolve in future versions. Each range object is constructed by a base Date::Handler object. Then combined to that is a Date::Handler::Delta will specify the length of the range. Then thirdly, the range is given a direction, either ’FORWARDS’ or ’BACKWARDS’ in time. From these three values are calculated a start date and an end date.

Example:



        #Creation of the range starting now, ending in 2 days.
        my $range = Date::Handler::Range->new({
                                                        date => time(),
                                                        delta => [0,0,2,0,0],
        });

        #This is already set to FORWARDS by default.
        $range->Direction(FORWARDS);

        print "This range start ".$range->StartDate()." and ends ". $range->EndDate()."\n";

        #Another range, starting at the end date of range 1, going backwards in time 7 days.
        my $range2 = Date::Handler::Range->new({
                                                date => $range->StartDate(),
                                                delta => [0,0,7,0,0],
                                                });

        $range2->Direction(BACKWARDS);

        #This returns true if range overlaps range2.
        $range->Overlaps($range2);



As I said earlier, the range functionnality is still very primitive, and the interface might change. Refer to Date::Handler::Range(1) for more information.

BUGS (known)

Deltas going after 2038 are not handled by this module yet. (POSIX)

Deltas before 1902 are not handled by this module. (POSIX)

If you find bugs with this module, do not hesitate to contact the author. Your comments and rants are welcomed :)

TODO

Implement overloading on ranges. Provide the value of the overlap in Overlaps()

COPYRIGHT

Copyright(c) 2001 Benoit Beausejour <bbeausej@pobox.com>

All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.

Portions Copyright (c) Philippe M. Chiasson <gozer@cpan.org>

Portions Copyright (c) Szabo\k:'Bala\k:'<dlux@kapu.hu>

Portions Copyright (c) Larry Rosler

AUTHOR

Benoit Beausejour <bbeausej@pobox.com>

SEE ALSO

Date::Handler(1). Date::Handler::Delta(1). Class::Date(1). Time::Object(1). Date::Calc(1). perl(1).

POD ERRORS

Hey! <B>The above document had some coding errors, which are explained below:B>
Around line 240: Non-ASCII character seen before =encoding in ’Szabo\k:'Assuming ISO8859-1
Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 HANDLER::RANGE (3) 2002-09-19

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.