This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Svelte and Sapper in Action and have Mark Volkmann on-line!
See this thread for details.
Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

timestamp display problem

 
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
 
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)
 
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.
 
"I know this defies the law of gravity... but I never studied law." -B. Bunny Defiant tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic