Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

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

Report information
The Basics
Id: 75498
Status: resolved
Priority: 0/
Queue: DateTime-Format-Strptime

People
Owner: Nobody in particular
Requestors: MARKLE [...] cpan.org
Cc:
AdminCc:

Bug Information
Severity: Unimportant
Broken in:
  • 1.4000
  • 1.5000
Fixed in: (no value)



Subject: documentation - do %m, %d, %H, %M pad w/ leading 0's in format_datetime()?
%T and %F pad zeros in format_datetime(). Do %m, %d, %H, %M do the same when used individually in a format string? Documentation is technically incorrect-- "The hour (0−23)" s/b "The hour (00−23)" etc. ... with the caveat that they will parse unpadded numbers in parse_datetime(). Thanks, keep up the good work. -Mark
BASH% cat ~/foo.pl #!/usr/bin/perl use strict; use warnings FATAL => 'all'; use DateTime; use DateTime::Format::Strptime; my $fmt = DateTime::Format::Strptime->new( pattern => '%Y %m %d %H %M %S', ); my $dt = DateTime->now(); print $fmt->format_datetime($dt), "\n"; {2012-03-02 20:08:20 PST -0800} BASH% ~/foo.pl 2012 03 03 04 08 23 {2012-03-02 20:08:23 PST -0800}