in reply to date to epoch

If you use Date::Calc, you could use the function Mktime for this (after splitting your string, e.g. using a regex).
$time = Mktime($year,$month,$day, $hour,$min,$sec);

Replies are listed 'Best First'.
Re^2: date to epoch
by Renjith777 (Initiate) on Nov 15, 2011 at 09:09 UTC
    I am new to perl.. Could you please give me a sample code ?

      # assumption: yyyymmddhhmmss $date =~ /(....)(..)(..)(..)(..)(..)/; my $year = $1; my $month = $2; ... my $sec = $6;
      However consider using character-classes (e.g. \d for a digit) and checking if $date is really in in the expected format instead of this "quick and dirty" solution.

        I tired this one and got following error Can't locate Date/Calc.pm in @INC (@INC contains: D:/strawberry/perl/site/lib D:/strawberry/perl/vendor/lib D:/strawberry/perl/lib .)