http://qs321.pair.com?node_id=1224905


in reply to Re: Converting datetime string to valid localtime value (seconds)
in thread Converting datetime string to valid localtime value (seconds)

Alternatively, don't parse the monthnames yourself and use the core module Time::Piece instead:

#!/usr/bin/env perl use strict; use warnings; use Time::Piece; my $source = 'Mon Oct 29 15:59:06 2018'; my $time = Time::Piece->strptime ($source, '%a %b %d %T %Y'); # Now use it however you wish print $time->datetime . "\n"; print "Today is " . $time->fullday . "\n";
  • Comment on Re^2: Converting datetime string to valid localtime value (seconds)
  • Download Code