the datetime strftime() methods require year >= 1900 ... come risolvere?

2 messages Options
Embed this post
Permalink
Vito

the datetime strftime() methods require year >= 1900 ... come risolvere?

Reply Threaded More More options
Print post
Permalink
Ciao a tutti,
ho creato un mio oggettino che memorizza alcuni dati, tra i quali esiste un campo DateField che – a seconda dei casi – potrebbe anche memorizzare una data piuttosto antica.
Se provo a immettere una data come 01/10/1560 ottengo un errore:

ValueError: year=1560 is before 1900; the datetime strftime() methods require year >= 1900

Come posso fare a risolvere?

Vito


--
"Design is the method of putting form and content together. Design, just as art, has multiple definitions; there is no single definition. Design can be art. Design can be aesthetics. Design is so simple, that's why it is so complicated." by Paul Rand

_______________________________________________
Plone-IT mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/plone-it
http://www.nabble.com/Plone---Italy-f21728.html
SauZheR at gOOgle

Re: the datetime strftime() methods require year >= 1900 ... come risolvere?

Reply Threaded More More options
Print post
Permalink
da quello che leggo, la limitazione potrebbe essere solo di strftime...
se cosi' fosse allora basta scomporre il tuo oggettodata nei vari pezzi:
"%s/%s/%s"% (oggettodata.year(), oggettodata.month(), oggettodata.day())

per i metodi sono andato a memoria... controlla nell'help di zope alla
voce DateTime.

bye

2009/10/21 Vito Falco <[hidden email]>:

> Ciao a tutti,
> ho creato un mio oggettino che memorizza alcuni dati, tra i quali esiste un
> campo DateField che – a seconda dei casi – potrebbe anche memorizzare una
> data piuttosto antica.
> Se provo a immettere una data come 01/10/1560 ottengo un errore:
>
>> ValueError: year=1560 is before 1900; the datetime strftime() methods
>> require year >= 1900
>
> Come posso fare a risolvere?
>
> Vito
>
>
> --
> "Design is the method of putting form and content together. Design, just as
> art, has multiple definitions; there is no single definition. Design can be
> art. Design can be aesthetics. Design is so simple, that's why it is so
> complicated." by Paul Rand
>
> _______________________________________________
> Plone-IT mailing list
> [hidden email]
> http://lists.plone.org/mailman/listinfo/plone-it
> http://www.nabble.com/Plone---Italy-f21728.html
>


--
  bye
SauZheR
************************************
l'iterazione è umana...
la ricorsione, Divina!
************************************
reply to: sauzher AT gmail DOT com


_______________________________________________
Plone-IT mailing list
[hidden email]
http://lists.plone.org/mailman/listinfo/plone-it
http://www.nabble.com/Plone---Italy-f21728.html