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

Gitte Wange gitte@mmmanager.org
Thu, 17 May 2001 15:02:24 +0200


On Thursday 17 May 2001 13:00, Tino Wildenhain wrote:
> 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.

Well when I try this, I get this error:

Zope Error

Zope has encountered an error while publishing this resource.

Error Type: AttributeError
Error Value: 'string' object has no attribute 'strftime'

I also tried the other solution, but I got an error saying that the Y wasn't 
a known format type.

Anyone who can help me ?

Regards
Gitte Wange

>
> 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 )