mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Add timezone to datetime objects. Refs #962.
Based on https://github.com/getpelican/pelican/pull/977, but it adds timezone information before formatting. Signed-off-by: OGINO Masanori <masanori.ogino@gmail.com>
This commit is contained in:
parent
8d14872700
commit
2c50ccb764
92 changed files with 259 additions and 247 deletions
|
|
@ -263,6 +263,9 @@ class TestUtils(LoggedTestCase):
|
|||
self.assertEqual(utils.strftime(d, '%d/%m/%y'), '29/08/12')
|
||||
self.assertEqual(utils.strftime(d, '%d/%m/%Y'), '29/08/2012')
|
||||
|
||||
# RFC 3339
|
||||
self.assertEqual(utils.strftime(d, '%Y-%m-%dT%H:%M:%SZ'),'2012-08-29T00:00:00Z')
|
||||
|
||||
# % escaped
|
||||
self.assertEqual(utils.strftime(d, '%d%%%m%%%y'), '29%08%12')
|
||||
self.assertEqual(utils.strftime(d, '%d %% %m %% %y'), '29 % 08 % 12')
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue