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

Thierry Collogne tcollogne at hotmail.com
Mon Jan 9 11:14:44 CET 2006


You were right.

I used this for solving my issue

http://mail.opencms.org/pipermail/opencms-dev/2005q3/019274.html

Thanks


>From: Achim Westermann <a.westermann at alkacon.com>
>Reply-To: The OpenCms mailing list <opencms-dev at opencms.org>
>To: The OpenCms mailing list <opencms-dev at opencms.org>
>Subject: Re: [opencms-dev] How to format date with cms:contentshow
>Date: Mon, 09 Jan 2006 11:04:16 +0100
>
>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
>
>
>
>
>_______________________________________________
>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