[New-bugs-announce] [issue13927] Extra spaces in the output of time.ctime

Roger Caldwell report at bugs.python.org
Thu Feb 2 21:49:36 CET 2012

New submission from Roger Caldwell <roger at monkey.net>:

Hi.  I found this today and thought I would report.  I could not find anywhere that it was expected behavior.  When using time.ctime() to convert a date which only has 1 digit in the day position it returs a string with 2 spaces after the month vs one.

In [2]: import os,time

In [3]: time.ctime(os.path.getmtime('file.cfg'))
Out[3]: 'Tue Dec 13 18:52:58 2011'

In [4]: time.ctime(os.path.getmtime('14d-1.log'))
Out[4]: 'Tue Feb  1 19:53:11 2011'

Is this expected behavior?

components: None
messages: 152475
nosy: Roger.Caldwell
priority: normal
severity: normal
status: open
title: Extra spaces in the output of time.ctime
type: behavior
versions: Python 2.7

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list