[docs] datetime.now() bug

maquema/Martin Maqueira (SPAIN System Administrator) maquema at coscoiberia.com
Fri Jun 10 13:13:43 CEST 2011


Hello Everybody.

 

I write you because I found a bug in datetime.now(). (tested in Python 2.6.6 -r266:84297, Aug 24 2010, 18:46:32-win32) This bug is that sometime doesn´t return milliseconds.

 

The code to reproduce the bug is: you have to wait a lot of time (from 20 minutes to 2 hours)

 

 

from datetime import datetime

while True:

            a=str(datetime.now())

            try:

                        b=a.split(".")[1]

                        print b

            except:

                        print "exception a=%s (if you see in this case there are not the milliseconds) " % (str(a))

                        break

 

 

I new in this . Programing and python specially.

 

Best Regards

 

 

 
COSCO Iberia S.A.- Barcelona
SPAIN IT Dept.
Tel: +34 933 047 125
Fax:+34 933 047 128 
e-mail: maquema at coscoiberia.com <mailto:maquema at coscoiberia.com> 

www.coscoiberia.es <blocked::file://www.coscoiberia.es/>  

 

 

  



 




DISCLAIMER:
En cumplimiento del artículo 5 de la Ley Orgánica de Protección de Datos 15/1999, le informamos que sus datos personales están incorporados a un fichero denominado clientes, con la única finalidad de mantener relaciones profesionales. Si lo desea puede ejercer los derechos de acceso, rectificación, cancelación u oposición de sus datos personales dirigiéndose a: COSCO IBERIA  S.A. -Responsable Protección de Datos- calle Casanova, 2, 6ª planta de Barcelona (08011).
Este mensaje y cualquier documento que lleve adjunto, es confidencial y destinado únicamente a la persona o entidad a quien ha sido enviado. Si Usted ha recibido este mensaje por error, le informamos que el contenido en el mismo es reservado y el uso no autorizado está prohibido legalmente,por ello,por favor , le rogamos que nos lo notifique al e-mail: manager at coscoiberia.com o al teléfono 93 304 71 26
Si su e-mail no ha podido ser entregado al buzón de su destinatario,  por favor reenvíelo a la dirección coscoiberia at coscon.com
If your mail could not be delivered correctly, please resend it to coscoiberia at coscon.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/docs/attachments/20110610/1d22536c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image003.jpg
Type: image/jpeg
Size: 3330 bytes
Desc: image003.jpg
URL: <http://mail.python.org/pipermail/docs/attachments/20110610/1d22536c/attachment-0001.jpg>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image004.gif
Type: image/gif
Size: 2393 bytes
Desc: image004.gif
URL: <http://mail.python.org/pipermail/docs/attachments/20110610/1d22536c/attachment-0001.gif>


More information about the docs mailing list