in reply to Date::Parse - how to correctly parse dates between 1901 and 1969

Not exactly. Time::Local says, that, depending on Perl version, it relies upon the system's time_t, which in turn holds a number of seconds since 1970-01-01 00:00. This would be negative for datetimes before 1970-01-01.

You interpret the epoch value unsigned, which makes it "jump" between 1969-12-31 23:59 and 1970-01-01 00:00.

  • Comment on Re: Date::Parse - how to correctly parse dates between 1901 and 1969
  • Download Code

Replies are listed 'Best First'.
Re^2: Date::Parse - how to correctly parse dates between 1901 and 1969
by eniad (Acolyte) on Feb 19, 2018 at 20:49 UTC
    How should I correctly interpret the value as signed?
      With a %d format, as per sprintf. BTW your data indicates another wraparound between 1900-12-31 and 1901-01-01.

      Therefore, I wouldn't use epoch seconds here, anyway. Perhaps one of the DateTime::Format modules can become your friend?

        Ah, I see. I should have paid more attention to my output. I just just trying to make it look nice! I'll look more closely at the DateTime::Format modules. Thanks.