#!/usr/bin/env python # # Copyright 2007 Doug Hellmann. # """Print dates in locale-specfic format. """ #end_pymotw_header import locale import time sample_locales = [ ('USA', 'en_US'), ('France', 'fr_FR'), ('Spain', 'es_ES'), ('Portugal', 'pt_PT'), ('Poland', 'pl_PL'), ] for name, loc in sample_locales: locale.setlocale(locale.LC_ALL, loc) print '%20s: %s' % (name, time.strftime(locale.nl_langinfo(locale.D_T_FMT)))