[Zope] ExtFile date format

Dieter Maurer dieter@handshake.de
Fri, 24 Jan 2003 22:56:32 +0100


Mike Bunyan wrote at 2003-1-23 22:22 +0000:
 > I would like to change the date format used in ExtFile to include the
 > year like %Y%m%d%H%M%S. At present the script will on accept
 > %m%d%H%M%S
 > 
 > Using the extra characters created by %Y gets the zope error:
 > Error Type: ValueError
 > Error Value: int() literal too large: 20030123222057
 > 
 > I am setting the FILE_FORMAT = "%n-%t%e"
 > Changing Line 590 to:
 > counter = int(DateTime().strftime('%Y%m%d%H%M%S'))
 > 
 > What's else needs to be changed please?
The "int" data type has a limit: its a bit above 2.000.000.000.

If you need something bigger, you must use "long" (which
does not have a limit).
However, the "%i" and "%d" format specifiers can overflow.
You can try "%s" or you need to provide your own conversion
from long to string.


Dieter