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";
|
---|
In Section
Seekers of Perl Wisdom