#!/bin/bash

# Display the date and time in all locales
# using the "%x", "%X", "%Ex", and "%EX" conversion specifiers.
# http://www.gnu.org/software/coreutils/manual/coreutils.html#date-invocation
# http://www.opengroup.org/onlinepubs/009695399/functions/strftime.html

#LOCALES=$(locale -a)
LOCALES=$(locale -a | grep 'utf8$')

for l in $LOCALES; do
  export LC_TIME=$l
  echo -n "$l   "
  date +%x -d 'Jan 31 2008 13:00' | tr -d '\n'
  echo -n '   '
  date +%X -d 'Jan 31 2008 13:00'
  echo -n "$l   "
  date +%Ex -d 'Jan 31 2008 13:00' | tr -d '\n'
  echo -n '   '
  date +%EX -d 'Jan 31 2008 13:00'
  echo
done

