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.# assumption: yyyymmddhhmmss $date =~ /(....)(..)(..)(..)(..)(..)/; my $year = $1; my $month = $2; ... my $sec = $6;
In reply to Re^3: date to epoch
by Ratazong
in thread date to epoch
by Renjith777
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |