[Zope] Is Zope portable ?

Brian Lloyd Brian@digicool.com
Fri, 26 Feb 1999 09:41:39 -0500


> HI GOZ,
> 
> I have a problem with the float method 
> from DateTime module !!
> It seems that Linux and WIN32 
> platform(NT) do not give the same 
> result.
> Is there an explanation?
> 
> NT (Zope 1.1.02)
> -----------------------
> >>> z=DateTime.DateTime('1999/02/25 
> 0:00pm US/EASTERN')
> >>> z
> DateTime('1999/02/25  12:00:00 
> US/Eastern')
> >>> float(z)
> 919962000.0
> 
> LINUX (Zope 1.9)
> ------------------------
> >>> z=DateTime.DateTime('1999/02/25 
> 0:00pm US/EASTERN')
> >>> z
> DateTime('1999/02/25  12:00:00 
> US/Eastern')
> >>> float(z)
> 35849.7083333

This doesn't have anything to do with the platforms - it
has to do with the fact that you are using two different
Zope versions. Prior to 1.10, calling float() on a DateTime
would return the number of days since Jan. 1, 1901 (gmt).

As of 1.10, this was apparently changed to return the number
of seconds since the epoch (gmt) (note that this is also the
case with int() and long() on a DateTime). I seem to recall a
discussion on the list about this, but I dont remember the 
details (you can probably find them in the archives, though).


Brian Lloyd        brian@digicool.com
Software Engineer  540.371.6909              
Digital Creations  http://www.digicool.com