Joshua Hoblitt schreef:
> - when from_object is used should the value for seconds returned by
> utc_rd_values be stored then returned by the object itself?  This
> would allow chaining of calendars without a loss of precision.

Best would probably be te either use Mayan time (if it is known
(probably not)), or to implement 'our' time (complete with timezones
etc.).

The last option can be done very easily by including the line:

    use DateTime::Time;

(as soon as I have written that module, of course...)

This would also solve the following problem:

    $d = DateTime->new( year => 2003, month  => 4, day    => 3,
                        hour => 0,    minute => 0, second => 0 );
    $md = DateTime::Calendar::Mayan->from_object( object => $d );

    print $md->date, "\n";  # prints 12,19,10,2,10

    $d = DateTime->new( year => 2003, month  => 4, day => 3,
                        hour => 0,    minute => 0, second => 0,
                        time_zone => 'Europe/Amsterdam' );
    $md = DateTime::Calendar::Mayan->from_object( object => $d );

    print $md->date, "\n";  # prints 12,19,10,2,9


Some other things I noticed:

Baktun's are numbered 13, 1, 2, 3, ..., 12 (and repeat). Yours are
numbered -inf, ..., -2, -1, 0, 1, 2, ..., +inf, so the module will only
give the correct long count from about 2700BC to about 2400AD. You may
want to add a 'cycle' count (1 cycle = 13 baktuns). Also, the default
value for baktun should perhaps be 13.

You use a comma as default separator for the long count. On the web,
I've only found periods.

Eugene

Reply via email to