The reason it was printing in numbers is because you weren't printing it in scalar context.
Try:
$time = scalar localtime;
$day = substr($time, 0,3);
print $day;
If it's printed without scalar context, it gives a list of values in the format:
($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst)
See the documentation page on
localtime() for more info.