#!/usr/bin/perl use strict; use warnings; use Date::Manip; use feature 'say'; my @dates = ( "2018-02-20 00:00:00", "20180220", "02/20/2018", "02/20/18", # interpreted as 1918-02-20 "2018-02-20", "today", # current date "now" # current date with also time ); say UnixDate( ParseDate($_), "%Y-%m-%d %T %Z") for (@dates); __END__ $ perl test.pl in.txt 2018-02-20 00:00:00 CET 2018-02-20 00:00:00 CET 2018-02-20 00:00:00 CET 2018-02-20 00:00:00 CET 2018-02-20 00:00:00 CET 2018-02-20 00:00:00 CET 2018-02-20 18:03:16 CET