[Tutor] Formatting date/time

Joel Goldstick joel.goldstick at gmail.com
Wed Aug 4 21:23:35 CEST 2010


On Wed, Aug 4, 2010 at 2:45 PM, Eric Hamiter <ehamiter at gmail.com> wrote:

> There are a few solutions here:
>
>
> http://stackoverflow.com/questions/904928/python-strftime-date-decimal-remove-0
>
> Eric
>
>
>
> On Wed, Aug 4, 2010 at 1:30 PM, Eduardo Vieira <eduardo.susan at gmail.com>wrote:
>
>> I'm trying this example from python docs:
>> from time import gmtime, strftime
>> strftime("%a, %d %b %Y %H:%M:%S +0000", gmtime())
>>
>> Output = 'Wed, 04 Aug 2010 17:58:42 +0000'
>> Is not there a string formatting option for the day without a leading
>> zero? Like: 'Wed, 4 Aug 2010 17:58:42 +0000'
>>
>> It looks like it's not in the docs.
>>
>> Thanks
>>
>> Eduardo
>>
>
%e worked for me on Python 2.6.5 (r265:79063, Apr 16 2010, 13:09:56)


-- 
Joel Goldstick
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100804/22308eb6/attachment.html>


More information about the Tutor mailing list