[Zope] RE: [Zope-dev] date formatting / extracting substrings

Chris McDonough chrism@digicool.com
Thu, 7 Sep 2000 02:31:50 -0400


Hi Jeff,

(I've moved this to the Zope list out of Zope-Dev)

<dtml-let month_value="MonthID[4:]">
... do something with the result ...
</dtml-let>

Have a look at the Python documentation as it relates to "slicing".

> -----Original Message-----
> From: Jeff Nielsen / Ugo Fast [mailto:Jeff@UgoFast.com]
> Sent: Thursday, September 07, 2000 1:10 AM
> To: Zope-Dev@Zope. Org
> Subject: [Zope-dev] date formatting / extracting substrings
> 
> 
> Hello out there in Zope world!
> 
> Again, I'm completely baffled by Zope and the docs are no 
> help either. I'm
> trying to take an input of a date in the form YYYYMM as the 
> variable MonthID
> and create a string in the form Month, YYYY as a variable 
> named MonthName.
> For instance, a MonthID of 200009 should return a MonthName 
> of "September,
> 2000".
> 
> I've been looking in the docs and the emails, but I can't 
> figure out how to
> extract substrings. I think something like this should work 
> to seperate the
> month value from the MonthID, but it doesn't:
> 
> <dtml-call "REQUEST.set('MonthValue', _.substring(MonthID,5,2))">
> 
> Any guidance would be appreciated.
> 
> -----------------------
> Jeff Nielsen
> http://www.UgoFast.com/
> "Where U Go Fast"
> 
> 
> _______________________________________________
> Zope-Dev maillist  -  Zope-Dev@zope.org
> http://lists.zope.org/mailman/listinfo/zope-dev
> **  No cross posts or HTML encoding!  **
> (Related lists - 
>  http://lists.zope.org/mailman/listinfo/zope-announce
>  http://lists.zope.org/mailman/listinfo/zope )
>