[opencms-dev] How to format date with cms:contentshow

Achim Westermann a.westermann at alkacon.com
Mon Jan 9 11:04:16 CET 2006


Hi Thierry,

there have been similar posts on this in 12/05 (I think). Try searching the archieve for "format date" or dateconv... (don't remember).

kind regards,

Achim

-- 
Achim Westermann
-------------------
Alkacon Software
http://www.alkacon.com
Thierry Collogne wrote:
> Hi all,
> 
> I have a custom xml content and I am using the following code to display 
> the content
> 
> 
> <body>
>      <cms:editable/>
> 
>      <div class="element">
>         <cms:contentload collector="allInFolderDateReleasedDesc" 
> param="/playground/events/news_${number}.html|wdog_article" 
> editable="true">
>            <h2><cms:contentshow element="Title" /></h2>
>            <p><cms:contentshow element="Date"/></p>
>            <cms:contentcheck ifexists="Image">
>                <img src="<cms:link><cms:contentshow 
> element="Image"/></cms:link>">
>            </cms:contentcheck>
>            <p><cms:contentshow element="Text"/></p>
>         </cms:contentload>
>      </div>
> 
> </body>
> 
> 
> The problem is that the "Date" element is displayed as a long, not as a 
> formatted date. Does anyone know how I can format this.
> 
> I know that in the java api there is a CmsDateUtil class which can be 
> used for formatting, but I don't know how I can get the value of "Date" 
> element for using the getDateTimeShort(long time) method.
> 
> I have tried the following, but that doesn't work
> 
> <%
>               out.print(CmsDateUtil.getDateTimeShort(<cms:contentshow 
> element="Date"/>));
> %>
> 
> 
> 
> Anyone?
> 
> 
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev






More information about the opencms-dev mailing list