"""Locale patterns for datetime formatting.
>>> Locale('en').datetime_formats['full']
- u'{1} {0}'
+ u"{1} 'at' {0}"
>>> Locale('th').datetime_formats['medium']
u'{1}, {0}'
locale = Locale.parse(locale)
if format in ('full', 'long', 'medium', 'short'):
return get_datetime_format(format, locale=locale) \
+ .replace("'", "") \
.replace('{0}', format_time(datetime, format, tzinfo=None,
locale=locale)) \
.replace('{1}', format_date(datetime, format, locale=locale))
d = datetime(2012, 4, 1, 15, 30, 29, tzinfo=timezone('UTC'))
epoch = float(calendar.timegm(d.timetuple()))
formatted_string = dates.format_datetime(epoch, format='long', locale='en_US')
- self.assertEqual(u'April 1, 2012 3:30:29 PM +0000', formatted_string)
-
+ self.assertEqual(u'April 1, 2012 at 3:30:29 PM +0000', formatted_string)
class FormatTimeTestCase(unittest.TestCase):