[opencms-dev] Problems with property date

Corsin Camichel cocaman at gmail.com
Thu Dec 15 16:53:48 CET 2005


Hi Patricia

OpenCMS saves all datetimes in a timestamp in milliseconds ( I think thats
Java standard).

I can show you how we format this timesamps

<c:set var="dateInMs"><cms:contentshow element="EventDatum" /></c:set>
<%
java.util.Date tmp = new java.util.Date(Long.parseLong(
pageContext.getAttribute("dateInMs").toString()));
Format formatter = new SimpleDateFormat("E dd.MM.yyyy",
cms.getRequestContext().getLocale());
out.println(formatter.format(tmp).toString().toUpperCase());
 %>

Hope this helps

Regards
Corsin

On 12/15/05, Patricia Ferre Zudaire <pferre at sgi.es> wrote:
>
> Hello list,
>
>    I have defined an xsd with a DateTime property called "Date".
>
>    If I want to display it, I do:
>
>    <cms:contentload collector="singleFile" param="${opencms.uri}"
> editable="true">
>    <cms:contentcheck ifexists="Date">
>                 <cms:contentshow element="Date" />
>    </cms:contentcheck>
>
>    These one dspaly a timestamp. But I want to formt it, and when I try
> to use it with Java (using :
>
> <% CmsJspActionElement cms = new CmsJspActionElement(pageContext,
> request, response);
>    String d = cms.property("Date");
>    out.println(d);
> %>
>
>     I obtain "null". How can I do it, please??
>
>     Thanks a lot and best regards
>

--
Corsin Camichel
cocaman at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://webmail.opencms.org/pipermail/opencms-dev/attachments/20051215/55ebb954/attachment.htm>


More information about the opencms-dev mailing list