locales = """ af_ZA am_ET be_BY bg_BG ca_ES cs_CZ da_DK de_AT de_CH de_DE el_GR en_AU en_CA en_GB en_IE en_NZ en_US es_ES et_EE eu_ES fi_FI fr_BE fr_CA fr_CH fr_FR he_IL hr_HR hu_HU is_IS it_CH it_IT ja_JP ko_KR lt_LT nl_BE nl_NL no_NO pl_PL pt_BR pt_PT ro_RO ru_RU sk_SK sl_SI sr_YU sv_SE tr_TR uk_UA zh_CN zh_HK zh_TW """.strip().split() from _strptime import LocaleTime import locale, time t = time.localtime() for l in locales: try: locale.setlocale(locale.LC_ALL, l) except locale.Error: continue s = time.strftime('%c', t) try: a = time.strptime(s, '%c')[:6] except ValueError as e: guess = LocaleTime().LC_date_time fmt = locale.nl_langinfo(locale.D_T_FMT) actual= fmt.replace('%X', locale.nl_langinfo(locale.T_FMT)) print("%s [%s] %s != %s" % (l, s, guess, actual))