in reply to Re^2: date to epoch
in thread date to epoch

# 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.

Replies are listed 'Best First'.
Re^4: date to epoch
by Renjith777 (Initiate) on Nov 15, 2011 at 09:19 UTC

    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 .)

      You need to install this module if you want to use it:

      cpan Date::Calc

      See also Installing Modules.

      20111221123526 is the format which I need to convert to epoch