convert mmddyy date format to ccyyddd format??

hi,

for reading a cobol indexed file i need to convert "mmddyy" date format to "ccyyddd" format.
i checked the datecalc and other scripts but couldnt modify them to cater to my need:(...

The datecalc gives an output which i believe is the total days till that date, but i want to convert it in ccyyddd format

for exmple: for todays date:092706 (mmddyy) i want to convert it to "2006270" (ccyyddd), and similary say for for any other date.

thanks in advance!!!

regards,
Bhups

try this

scp
mm=`expr substr "$1" 1 2`
dd=`expr substr "$1" 3 2`
yyyy="20""`expr substr "$1" 5 2`"

ddd=`cal_days $yyyy $mm $dd`

echo "$yyyy$ddd"

Perl script

cal_days
#!/bin/perl
use Time::Local;
my $year=shift;
my $month=shift;
my $day=shift;
my $time = timelocal(0,0,23,$day,$month-1,$year-1900);
my $time1 = timelocal(0,0,0,1,0,$year-1900);
my $days = ( $time -$time1 ) / 86400;
printf("%.0f", $days);
$scp 092706
2006270

thanks alot bro...works fine:)