in reply to Two digit year with DateTime?

Time::Piece has been a core module since at least 5.10 so can save you having to install extra modules.

johngg@shiraz:~/perl/Monks$ perl -Mstrict -Mwarnings -MTime::Piece -E +' my $tp = localtime(); say qq{2-digit year - }, $tp->yy();' 2-digit year - 19

I hope this is helpful.

Cheers,

JohnGG

Replies are listed 'Best First'.
Re^2: Two digit year with DateTime?
by Your Mother (Archbishop) on Mar 11, 2019 at 19:52 UTC

    This is how dumb I am: I first read the “19” as being the leading two digits of the date and wondered why the library did that and why you were posting broken code… :|

      A person has to look for the matching single quote marks with many of johngg's replies. They are technically one-liners but legible perl on the terminal and effective as sscce.

        This was just me still dating checks in my mind from the last century, thinking it's still the 1900s. Neurons pining for the good old days and many lost companions. :P