Skip Menu |

This queue is for tickets about the DateTime-Format-Epoch CPAN distribution.

Report information
The Basics
Id: 40276
Status: new
Priority: 0/
Queue: DateTime-Format-Epoch

People
Owner: Nobody in particular
Requestors: donhorner [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 0.11
Fixed in: (no value)



Subject: Missing nanosecond information
I'm replacing an older time conversion module use where I work with calls to DateTime. I noticed that when converting from MJD to a calendar date using DateTime::Format::Epoch::MJD that the seconds value in $dt->hms is truncated where the old module rounded the seconds. Not a problem, I figured. I can just get $dt->fractional_second and do the rounding myself to replicate the existing behavior. However, I found that there is no nanosecond information in the formatter object returned by DateTime::Format::Epoch::MJD. Looking at parse_datetime Epoch.pm, I can see that $delta_nano is calculated but nothing is done with it. I added "rd_nanosecs => $delta_nano" to the $temp_dt object and "$self->{rd_nanosecs}" to DateTime::Format::Epoch::_DateTime::utc_rd_values. I don't know if this is a complete and correct fix, but now $dt->fractional_second returns what I expect. Could you make sure to add the nanosecond information into the object in future revisions?