Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

timestamp display problem

 
arjun rampal
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi on jsp using struts page I am displaying the timestamp

result-

Now rather than showing all values I wish to show only 07:20:16 means no date and no last 0 which is indiacating nanao seconds.

Now substring was option but the value returned is date here not string
 
Arulanand Dayalan
Ranch Hand
Posts: 128
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Use the formatkey property of Bean:Write

<bean:write property="test" name="testform" formatKey="formatkey"/>


Could be specified in the property file or directly specfied.

formatkey = "MM/dd/yyyy";
 
arjun rampal
Ranch Hand
Posts: 125
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
solution


<td><bean:write name="detail" property="aTime" formatKey="org.apache.struts.taglib.bean.format.sql.timestamp" /></td>


and value in application properties like this

org.apache.struts.taglib.bean.format.sql.timestamp=hh:mm:ss

YA and after doing this restart your IDE
(use hh for 12 hour and HH FOR 24 HOUR)
 
Merrill Higginson
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Arjun,

Please don't post the same question in multiple forums. It wastes the time of people responding to your question. This same question was posted by you in the JSP forum.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic