import csv
import datetime
+import numbers
import os
import re
"""
if self.code.startswith("ru"):
relative = False
- if type(date) in (int, long, float):
+ if isinstance(date, numbers.Real):
date = datetime.datetime.utcfromtimestamp(date)
now = datetime.datetime.utcnow()
if date > now:
from __future__ import absolute_import, division, print_function, with_statement
+import datetime
import os
import tornado.locale
from tornado.escape import utf8
self.assertTrue(isinstance(name, unicode_type))
self.assertEqual(name, u('Espa\u00f1ol'))
self.assertEqual(utf8(name), b'Espa\xc3\xb1ol')
+
+
+class EnglishTest(unittest.TestCase):
+ def test_format_date(self):
+ locale = tornado.locale.get('en_US')
+ date = datetime.datetime(2013, 4, 28, 18, 35)
+ self.assertEqual(locale.format_date(date, full_format=True),
+ 'April 28, 2013 at 6:35 pm')