[Zope] another one
D. Rick Anderson
ruger@comnett.net
Mon, 25 Feb 2002 08:56:59 -0800 (PST)
------=_JIB.,j:G1Uv?Qv69/OiYjtO)5Dp3rNJ1x(Y(L'C6Dt=lW.WKVpi-3Fpi.bPQ
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit
I'm trying to reformat a date that I'm getting from our Sybase server. I
get it in yyyy/mm/dd format and I'm trying to change it to mm/dd/yyyy
format. I've created a DTML method called fixDate that looks like this:
<dtml-call expr="REQUEST.set('date', _.str(date))">
<dtml-let newDate="date.split('/')" month="newDate[1]" day="newDate[2]"
year="newDate[0]">
<dtml-var month>/<dtml-var day>/<dtml-var year>
</dtml-let>
It works if I call http://www.ourdomain.com/fixDate?date=2002/12/25, but
if I try to use it from a DTML document I get:
Error Type: NameError
Error Value: global name 'REQUEST' is not defined
If I take out the first line then I get:
Error Type: AttributeError
Error Value: split
which is what prompted me to put it in to begin with. Any ideas?
TIA
Rick
------=_JIB.,j:G1Uv?Qv69/OiYjtO)5Dp3rNJ1x(Y(L'C6Dt=lW.WKVpi-3Fpi.bPQ
Content-Type: application/octet-stream;name=""
Content-Disposition: attachment; filename=""
Content-Transfer-Encoding: base64
DQo=
------=_JIB.,j:G1Uv?Qv69/OiYjtO)5Dp3rNJ1x(Y(L'C6Dt=lW.WKVpi-3Fpi.bPQ--