File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Struts and the fly likes Struts2 OGNL Timestamp format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "Struts2 OGNL Timestamp format" Watch "Struts2 OGNL Timestamp format" New topic

Struts2 OGNL Timestamp format

Patrick Kok
Ranch Hand

Joined: Nov 12, 2009
Posts: 42
How can I format a Timestamp attribute in OGNL?

public Timestamp getMyTimeValue(){
return new Timestamp(new Date().getTime())


<s:property value="myTimeValue" escape="true"/>

It returns to 1/15/10 12:46:39 PM.000

But I want to be dd/MM/yyyy hh:mm:ss aa

Please help
Patrick Kok
Ranch Hand

Joined: Nov 12, 2009
Posts: 42
oh, sorry.
I missed the <s:date>
I agree. Here's the link:
subject: Struts2 OGNL Timestamp format
Similar Threads
Log4j XMLLayout
Timestamp advanced 4 hours
How to convert timeStamp into corresponding date.
Format time in miliseconds using SimpleDateFormatter