What is the best way to convert yyyymmddhhmmss to YYYY-MM-DD hh:mm:ss and back in perl?
for example: 20130218165601 to 2013-02-18 16:56:01 and back? (can https://met
Quick solution with sprintf.
sprintf
my $date = sprintf "%s%s-%s-%s %s:%s:%s", $string =~ /(..)/g;
And back:
my $foo = join '', $date =~ /\d+/g;