[Zope] Invalid Date-Time String

Kapil Thangavelu kvthan@wm.edu
Tue, 08 Aug 2000 20:48:11 -0700


Oliver Frommel wrote:
> 
> hello,
> 
> I have a ZClass called "thema" with some date properties to change creation/
> modification dates independent of bobobase_modification_time. So I try to
> set one date property called "date1" equal to the current time of creation:
> 
>   <dtml-with "manage_addProduct['RadioObjects']">
>    <dtml-with "thema.createInObjectManager(ZopeTime().strftime('%Y%m%d%H%M%S'), REQUEST)">
>      <dtml-call "REQUEST.set('date1', ZopeTime())">
>      <dtml-call "propertysheets.prop.manage_editProperties(REQUEST)">
>    </dtml-with>
>   </dtml-with>
>  </dtml-with>
> 
> Unfortunately I am getting an "Invalid Date-Time String" error when
> calling the manage_editProperties. I tried some possible solutions from the
> mailing lists but failed so far, e.g. using ZopeTime or ZopeTime().DateTime()
> Any help?


Suggestion.
 it sounds like the property date is meant to be a string conforming to
the syntax that a Date Time Object can take and Zope does the conversion
when the property is used. the code above tries to place an actual date
time object in the propertysheet which wants a string which it can
covert. try

<dtml-let x="ZopeTime().strftime('InsertYourFormat')">
<dtml-call REQUEST.set('date1', x)
<dtml-call "propertysheets.prop.manage_editProperties(REQUEST)">
<dtml-let>

I hope that helps.

Cheers

Kapil