<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Thank you Peter,<br>
<br>
You know, I'm very new to Zope/Python and web applications.<br>
<br>
I will read more, and improve my Zope skils.<br>
<br>
And the support is great.<br>
<br>
Thank you all.<br>
<br>
Regards,<br>
<br>
Jorge<br>
<br>
<br>
<br>
<br>
Peter Millar wrote:
<blockquote cite="mid00a901c4f9d0$475e4250$0904000a@corp.parasyn.com.au"
 type="cite">
  <pre wrap="">I don't use dtml ... But the cookbook I mailed in my previous post has
this syntax:
&lt;li&gt; strftime(%Y/%m/%d) --&gt; &lt;dtml-var
expr="e.strftime('%Y/%m/%d')"&gt;&lt;/li&gt;&lt;br&gt;

I would say you are missing expr="" so your code should probably look
like

&lt;small&gt;&lt;dtml-var expr="LG_DATA.strftime('%Y-%m-%d')"&gt;&lt;/small&gt;

I use zpt and my code is way different it looks like:
&lt;td tal:content="python:rowdata.datetime.strftime('%d/%m/%Y
%X')"&gt;datetime&lt;/td&gt; 

I don't know that I can be of much more help unfortunately.

____________________________________________ 
Peter Millar 


-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:zope-bounces+peter.millar=parasyn.com.au@zope.org">zope-bounces+peter.millar=parasyn.com.au@zope.org</a>
[<a class="moz-txt-link-freetext" href="mailto:zope-bounces+peter.millar=parasyn.com.au@zope.org">mailto:zope-bounces+peter.millar=parasyn.com.au@zope.org</a>] On Behalf Of
Zorze
Sent: Friday, 14 January 2005 10:26
To: <a class="moz-txt-link-abbreviated" href="mailto:zope@zope.org">zope@zope.org</a>
Subject: Re: [Zope] Format date fields
Importance: High


&lt;dtml-in ZSQL_log&gt;   this is my Firebird connection

&lt;tbody&gt;
&lt;tr&gt;
&lt;table style=" width: 100%; text-align: left;" border="0" 
cellpadding="0" cellspacing="0"&gt;
    &lt;/td&gt;
    &lt;td style="width: 200px; vertical-align: center;"&gt;&lt;span 
style="font-family: tahoma;"&gt;&lt;br&gt;


&lt;small&gt;&lt;dtml-var "LG_DATA.strftime('%Y-%m-%d')"&gt;&lt;/small&gt;&lt;/td&gt; this is 
the string (since i'm Portuguese DATA means date)


&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;/dtml-in&gt;






Peter Millar wrote:

  </pre>
  <blockquote type="cite">
    <pre wrap="">Please post your code and more details about the error so that we can 
provide greater assistance. 
____________________________________________
Peter Millar

-----Original Message-----
From: <a class="moz-txt-link-abbreviated" href="mailto:zope-bounces@zope.org">zope-bounces@zope.org</a> [<a class="moz-txt-link-freetext" href="mailto:zope-bounces@zope.org">mailto:zope-bounces@zope.org</a>] On Behalf Of
    </pre>
  </blockquote>
  <pre wrap=""><!---->
  </pre>
  <blockquote type="cite">
    <pre wrap="">Zorze
Sent: Friday, 14 January 2005 10:18
To: <a class="moz-txt-link-abbreviated" href="mailto:zope@zope.org">zope@zope.org</a>
Subject: Re: [Zope] Format date fields
Importance: High


Thank you Andrew. :-)

But it give me another an error :-(

Error Value: You are not allowed to access strftime in this context

Regards


Andrew Milton wrote:
+-------[ Zorze ]----------------------
| Hi,
| I'am new to Zope so please excuse me about some stupid questions.

| How can I format a date field from in a DTML from ZSQL Method e.i.:

| It shows 2005-01-12 22:49:33:00

| but I want to show just 2005-01-12


Try these;

&lt;dtml-var "theDate.strftime('%Y-%m-%d')"&gt;

or

&lt;dtml-var "theDate.strftime('%F')"&gt; (same as above, just shorter).

| or  change de order of the date
| :01-12-2005.

&lt;dtml-var "theDate.strftime('%d-%m-%Y')"&gt;

 


 

    </pre>
  </blockquote>
  <pre wrap=""><!---->
_______________________________________________
Zope maillist  -  <a class="moz-txt-link-abbreviated" href="mailto:Zope@zope.org">Zope@zope.org</a>
<a class="moz-txt-link-freetext" href="http://mail.zope.org/mailman/listinfo/zope">http://mail.zope.org/mailman/listinfo/zope</a>
**   No cross posts or HTML encoding!  **
(Related lists - 
 <a class="moz-txt-link-freetext" href="http://mail.zope.org/mailman/listinfo/zope-announce">http://mail.zope.org/mailman/listinfo/zope-announce</a>
 <a class="moz-txt-link-freetext" href="http://mail.zope.org/mailman/listinfo/zope-dev">http://mail.zope.org/mailman/listinfo/zope-dev</a> )


  </pre>
</blockquote>
<br>
</body>
</html>