atoomic / perl-TimeDate

time & date parsing and formatting perl library
http://search.cpan.org/dist/TimeDate/
1 stars 3 forks source link

Date::Parse inconsistent year handling [rt.cpan.org #106105] #18

Open atoomic opened 4 years ago

atoomic commented 4 years ago

Migrated from rt.cpan.org#106105 (status was 'new')

Requestors:

From nhorne@cpan.org on 2015-07-26 23:42:09 :

This program:

#!/usr/bin/env perl

use strict;
use warnings;
use Date::Parse;

my @t = strptime('1 Jan 1901 12:00');

print $t[5], "\n";

@t = strptime('1 Jan 1899 12:00');

print $t[5], "\n";

Prints:

Nigels-MacBook-Pro:~ njh$ ./foo
1
1899
Nigels-MacBook-Pro:~ njh$ 

which is inconsistent to me.  Maybe there is something deep in the documentation about this inconsistency, but I couldn't find it.