[Zope] Help with calcualtions in DTML

Dario Lopez-Kästen dario@ita.chalmers.se
Mon, 4 Sep 2000 09:44:43 +0200


Hello!

I have the following listing of objects in my folder:

<table>
  <tr>
    <td><p><b>Name</b></p></td>
    <td align="right"><p><b>Size</b></p></td>
    <td align="right"><p><b>date</b></p></td>
  </tr>
<dtml-in expr="doc.objectValues()">
  <tr>
    <td>
      <p><a href="<dtml-var absolute_url>"><dtml-var id></a></p>
    </td>
    <td align="right">
      <p><dtml-var get_size> bytes</p>
    </td>
    <td align="right">
      <p><dtml-var bobobase_modification_time fmt="%Y-%m-%d %H:%M"></p>
    </td>
  </tr>
</dtml-in>
</table>

It gives me the name of the object, the size in bytes and the modification
time in GMT.

I need to do the following: express the size in kb, format the output with
spaces for thousands.

I also need the date displayed according to my locale (+2 GMT in Sweden) so
if bobobase_modification_time is 10:48, I need to show it as 8:48, and on
top of that I also need to take dayligth savings into account.

How do I do it? The fmt strings are abviously adjusted to US standards, so
us ISO-people need to hack our own format strings :-).

I know i could calculate the size in KB myself IF I only knew how to get the
get_size attribute into a calculation expression (that goes for
bobobase_modification_time as well, however this returns as string. How do I
get the date as a date?)

Any help is appreciated and needed. Thank you.

/dario

PS: has anyone been thinking of renaming bobobase_modification_time to
something shorter and more intuitive, like, say, modification_time?

:-))


- --------------------------------------------------------------------
Dario Lopez-Kästen     Systems Developer  Chalmers Univ. of Technology
dario@ita.chalmers.se  ICQ will yield no hits    IT Systems & Services