On Mon, 10 Sep 2001, srl wrote:

> Have you looked at Date::ICal?

Thanks for the pointer. I didn't found this on my CPAN mirror.


> What does your module do that Date::ICal doesn't?

I hope that Date::ICal does all I want so I can save the time porting
routines from an old perl script. :)

What I want to do is "next month" in an object oriented fashion. ICal
would allow me to do this:

        my $month = $ical->month();
        $month += 1; # may become 13
        $ical->month($month); # one could add this functionality

That should also be possible with Time-Objects. Or am I missing
something? Just for my understanding, could ICal be made an extension
for Time-Objects by adding the parsing routines for the ICal-format?

With my module, you just say $month->next(); regardless of the month. It
is the navigation in time I'm interested in. $time->month() is nothing I
paid special attention to so far.

        Time::OO->new()
                constructor

        $time->N->value()
                Gets or sets the value of the name N where N is from
                second, minute, hour, day, month, year, ...
                Currently accepts integer values only.

        $time->N->Ms()
                Returns constants for M lower than N (both taken from
                the set above). Example: $time->minute->seconds();
                I'm not fully satisfied with the naming.

        $time->N->in_M()
                Unit converstion within the set of names N. For both,
                N lower than M and N greater than M. (to be done)

        $time->N->forward()
        $time->N->backward()
                Move forward and backward in time, respecting any
                boundaries for the resulting numerical values.
                Currently only for integer values.

        $time->N->next()
        $time->N->former()
                Move forward or backward one unit in time.

        $time->N->modulus()
                Value at which the value of the next higher
                object is incremented. (v0.1.1)

        $time->N->remaining()
                Remaining units until value wraps back to 0.

        $time->epoch()
                Get or set the time in seconds since epoch (v0.1.1)

        $time->as_string()
                Convenience method to call POSIX::strftime


Yes, this is highly unfinished work. I will continue to work on it if
there is no other module with the same functionality yet.


Regards
-Winfried

Reply via email to