If you can't use GNU stat
, maybe you can sneak under the radar and use Perl's stat :-)
perl -MPOSIX -e 'print POSIX::strftime "%Y%m%d\n", localtime((stat $ARGV[0])[9])' yourfile
Result:
20140303
Many thanks to Glenn Jackman (see Comments below) for magnificently filling the role of "clever person" and showing me where I was going wrong. Thank you.