Craig:

I have my Python compiled with --locale and all the LC_ variables set to my locale's specifics for Mexico.

LANGUAGE=es_MX
LC_ALL=es_MX
LANG=es_MX

Zope is started with the -L parameter on the  /usr/local/Zope/start  script  :

#! /bin/sh
export TZ="America/Mexico_City"
#umask 077 for worldpilot use
umask 077
reldir=`dirname $0`
export Z_REALM='this system: '
PYTHONHOME=`cd $reldir; pwd`
export PYTHONHOME
exec /usr/bin/python \
     $PYTHONHOME/z2.py -u nobody -L es_MX -p '/home/httpd/somedirectory/zope-cgi-bin/Zope.cgi' \
       "$@"
 

Then what I use for date formatting in DTML methods is:

<dtml-call "ZopeTime().strftime('%Y%m%d%H%M%S')">   or
<dtml-var "ZopeTime().strftime('%Y%m%d%H%M%S')">   or
<dtml-call "REQUEST.set('somevariable', ZopeTime().strftime('%Y%m%d%H%M%S'))">     when you need to set a variable with a date

The %Y %m %d $H %M %S  are formatting strings to the strftime functions.  Look at the Zope Quick Reference for more information on this formatting variables, some of them DO use the locale settings defined above. You can control what you get on date formatting with strftime().

Hope this helps.

Felipe Barousse
Bufete Consultor de Mexico - Piensa Technology
 

Message: 13
To: zope@zope.org
From: "Craig Stoddart" 
Date:  13 Jun 2001 16:23:00 -0000
Subject: [Zope] Date formatting problems

I am trying to format the dates in my Squishdot site so that they don't app=
ear
in American format.

However, the following code: 
results in an error message saying

Error Type: TypeError
Error Value: illegal argument type for built-in operation

Does anyone have any idea what I am doing wrong=3F
-------------------------------------------------
Craig Stoddart
IT Software Development Officer

Dundee City Council
IT Division
Northern College
Technical Block
Gardyne Road
Dundee DD5 1NY

Phone:  01382 438170
Fax:    01382 438002
E-mail: craig.stoddart@dundeecity.gov.uk
-------------------------------------------------