[Zope] Splitting a datetime string into a date string and a time string

Tino Wildenhain tino@wildenhain.de
Thu, 17 May 2001 13:00:17 +0200


Hi Gitte,

assuming you only want to display the date,
you could use the fmt-attribute of the dtml-var tag.
<dtml-var YourDate fmt="%Y %m %d">
<dtml-var YourDate fmt="%H:%M:%S">

You can also use:

<dtml-var "YourDate.strftime('%Y %m %d')"> respectively.

HTH
Tino Wildenhain
--On Donnerstag, 17. Mai 2001 11:29 +0200 Gitte Wange <gitte@mmmanager.org> 
wrote:

> Hello,
>
> I have a small problem:
> In my database I have a datetime field.
> Now I need to split the content of that field into a date string and a
> time  string with these formats:
> date: YYYY/MM/DD
> time: HH:MM:SS
>
> How do I do that?
>
> Another thing:
> I also need to remove / : and spaces from the datetime string.
>
> How ?
>
> Regards
> --
> ************************
> Gitte Wange Jensen
>
> System Squid Developer
> MMManager Aps
> +45 29 72 79 72
>
> gitte@mmmanager.org
> ************************
>
> _______________________________________________
> Zope maillist  -  Zope@zope.org
> http://lists.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope-dev )