[Zope-DB] Zope+FB+mx - DateTime errrrrrrrror....
M.-A. Lemburg
mal at egenix.com
Thu Jul 15 17:04:26 EDT 2004
fowlertrainer at anonym.hu wrote:
> Hi !
>
> I think that I have been found a bug in mx.DateTime...
I don't think you are using mxDateTime here: the constructor
would be called DateTimeFrom() in that case.
>>> from mx.DateTime import DateTimeFrom
>>> DateTimeFrom('1899-12-30 01:00:00').strftime('%Y.%m.%d. %H:%M:%S')
'1899.12.30. 01:00:00'
Instead, you are probably looking at the Zope implementation;
also called DateTime, but completely unrelated to mxDateTime.
> So:
> I use FireBird, and in this RDBMS the datetime fields are "doubles".
> So if I set them to 0, the values the fields are '1899-12-30 01:00:00'.
>
> When I try to see this datetime as European format (YYYY.MM.DD HH:MM:SS)
> I get error.
>
> Example1:
> s='1899-12-30 01:00:00'
> nv=str(s)
> nv=DateTime(s)
> s=nv.strftime('%Y.%m.%d. %H:%M:%S')
> # it is makes error
>
> Example2:
> s='1900.01.01'
> nv=str(s)
> nv=DateTime(s)
> s=str(nv)
> # it is not makes error, but show the datetime in other format, not in
> needed.
>
> Example3:
> s='2002.03.04 05:06:07.00'
> nv=str(s)
> nv=DateTime(s)
> s=nv.strftime('%Y.%m.%d. %H:%M:%S')
> # this example don't makes error.
>
> I don't understand it, why CAN the mx convert the datetime to default
> format, and why cannot the needed ?
>
> Anybody can helps me ?
>
> Thanx for it:
> FT
>
>
>
> _______________________________________________
> Zope-DB mailing list
> Zope-DB at zope.org
> http://mail.zope.org/mailman/listinfo/zope-db
--
Marc-Andre Lemburg
eGenix.com
Professional Python Services directly from the Source (#1, Jul 15 2004)
>>> Python/Zope Consulting and Support ... http://www.egenix.com/
>>> mxODBC.Zope.Database.Adapter ... http://zope.egenix.com/
>>> mxODBC, mxDateTime, mxTextTools ... http://python.egenix.com/
________________________________________________________________________
::: Try mxODBC.Zope.DA for Windows,Linux,Solaris,FreeBSD for free ! ::::
More information about the Zope-DB
mailing list