In the spirit of TIMTOWTDI:
$date = "20031006"; $date = join "-",unpack("a4a2a2",$date);
Of course, I'd probably say doing it with the regex would be preferred.
antirice
The first rule of Perl club is - use Perl
The ith rule of Perl club is - follow rule i - 1 for i > 1
In reply to Re: formatting dates
by antirice
in thread formatting dates
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |