Recuperar fechas

JASB sierra en tecnisoft.com
Jue Dic 23 09:41:03 CET 2004


Ummm, veo que usas el módulo mx, pues bien, deberías echarle un vistazo
a "strftime" que te permite formatear la fecha a tu gusto, por ejemplo:

fecha = mx.DateTime.now().strftime("%d/%m/%Y")

Salu2.

El mié, 22-12-2004 a las 20:08, FERNANDO VILLARROEL escribió:

> Hola tengo un problema cuando recupero fechas de una
> BD, me lanza la siguiente excepcion:
> 
> Traceback (most recent call last):
>   File "/home/developer/chevalier/MnuClche.py", line
> 445, in OnBuscar
>    
> self.rut,self.dv,self.rz,self.di,self.co,self.pc,self.gi,self.tc,self.nc,self.ncc,self.ba,self.te1,self.te2,self.fc,self.com,self.es=cur.fetchone()
>   File
> "/usr/lib/python2.3/site-packages/pyPgSQL/PgSQL.py",
> line 3139, in fetchone
>     return self.__fetchOneRow()
>   File
> "/usr/lib/python2.3/site-packages/pyPgSQL/PgSQL.py",
> line 2776, in __fetchOneRow
>     _r.getvalue(self._idx_, _i)))
>   File
> "/usr/lib/python2.3/site-packages/pyPgSQL/PgSQL.py",
> line 804, in typecast
>     return DateTime.ISO.ParseAny(value)
>   File
> "/usr/lib/python2.3/site-packages/mx/DateTime/ISO.py",
> line 313, in ParseAny
>     raise ValueError,'unsupported format: "%s"' %
> isostring
> ValueError: unsupported format: "21-12-2004"
> 
> Como lo puedo solucionar?
> 
> Fernando Villarroel N.
> 
> 
> 		
> __________________________________ 
> Do you Yahoo!? 
> Meet the all-new My Yahoo! - Try it today! 
> http://my.yahoo.com
> 
> 
> 
> 
> ______________________________________________________________________
> 
> _______________________________________________
> Python-es mailing list
> Python-es en aditel.org
> http://listas.aditel.org/listinfo/python-es




Más información sobre la lista de distribución Python-es