Hi Dave,
I noticed that the fractional_second method is still in CVS. Is this going to be
dropped as well?
I took a look at changing utc_rd_values to support nanoseconds and it doesn't look
like much needs to be changed.
Calling _normalize_nanoseconds in the contructor certainly makes life easy. I can't
see any reason for _calc_utc_rd or _calc_local_rd to deal with nanoseconds so my first
email was incorrect.
If this looks reasonable I'll change the dev. docs to match.
Cheers,
-J
--
Index: lib/DateTime.pm
===================================================================
RCS file: /cvsroot/perl-date-time/modules/DateTime.pm/lib/DateTime.pm,v
retrieving revision 1.207
diff -u -r1.207 DateTime.pm
--- lib/DateTime.pm 13 Jun 2003 18:24:16 -0000 1.207
+++ lib/DateTime.pm 19 Jun 2003 06:24:57 -0000
@@ -383,17 +383,15 @@
my $object = delete $p{object};
- my ( $rd_days, $rd_secs ) = $object->utc_rd_values;
+ my ( $rd_days, $rd_secs, $rd_nanos ) = $object->utc_rd_values;
my %args;
@args{ qw( year month day ) } = $class->_rd2ymd($rd_days);
@args{ qw( hour minute second ) } = $class->_seconds_as_components($rd_secs);
+ $args{ nanoseconds } = $rd_nanos;
my $new = $class->new( %p, %args, time_zone => 'UTC' );
- $new->set( nanosecond => $object->nanosecond )
- if $object->can('nanosecond');
-
$new->set_time_zone( $object->time_zone )
if $object->can('time_zone');
@@ -693,7 +691,7 @@
sub language { $_[0]->{language} }
-sub utc_rd_values { @{ $_[0] }{ 'utc_rd_days', 'utc_rd_secs' } }
+sub utc_rd_values { @{ $_[0] }{ 'utc_rd_days', 'utc_rd_secs', 'rd_nanosecs' } }
# NOTE: no nanoseconds, no leap seconds
sub utc_rd_as_seconds { ( $_[0]->{utc_rd_days} * 86400 ) + $_[0]->{utc_rd_secs} }