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";
In reply to Re^2: Converting datetime string to valid localtime value (seconds)
by hippo
in thread Converting datetime string to valid localtime value (seconds)
by vladb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |