Subject: | synopsis incorrect. not normalized and zero padded where it shouldnt be |
#!/usr/bin/env perl
use 5.018;
use warnings;
use DateTime::Format::Duration;
my $d = DateTime::Format::Duration->new(
pattern => '%Y years, %m months, %e days, '.
'%H hours, %M minutes, %S seconds'
);
print $d->format_duration(
DateTime::Duration->new(
years => 3,
months => 5,
days => 1,
hours => 6,
minutes => 15,
seconds => 45,
nanoseconds => 12000
)
);
# 0 years, 41 months, 1 days, 00 hours, 375 minutes, 45 seconds
with normalize => 1
# 3 years, 05 months, 1 days, 06 hours, 15 minutes, 45 seconds
synopsis says it should return:
# 3 years, 5 months, 1 days, 6 hours, 15 minutes, 45 seconds