Default date format (and others), are setting in locale environment, you can verify this with "locale":
# locale
LANG=C
LC_CTYPE="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_COLLATE="C"
LC_MONETARY="C"
LC_MESSAGES="C"
LC_ALL=
the LC_TIME environment var controls most default's of date/time commands, you can check default date format with:
# locale d_t_fmt
%a %b %d %H:%M:%S %Z %Y
you can check that is true by doing some checks:
# date
Thu Sep 06 00:59:10 WEST 2001
date +"%a %b %d %H:%M:%S %Z %Y"
Thu Sep 06 01:00:48 WEST 2001
you can also verify all defaults for LC_TIME with "locale LC_TIME", and all defaults with "locale LC_ALL"
so if you want to change default format of date you can change the value of LC_TIME to a locale that holds your required format,i.e, you can check if POSIX holds the default value you want by:
# LC_ALL=POSIX locale -ck d_t_fmt
LC_TIME
d_t_fmt="%a %b %d %H:%M:%S %Y"
if none of present locales will handle your format you can always build a locale for you with all the formats you want, solaris provide a source file of locale:
"/usr/lib/localedef/src/iso_8859_1" that you can change to build your own locale, change it and just compile it with "localedef",i.e, if you locale is "mylocale":
# cd /usr/lib/localedef/src
# mkdir mylocale
# cp iso_8859_1/* ./mylocale
# cd mylocale
... change files ...and compile ..
# localedef -v -i localedef.src -f charmap.src -x extension.src mylocale
then
# export LC_ALL=mylocale
Hope it helps,
Regards,
Carlos Almeida,