Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

using jstl to format date and time  RSS feed

 
Thirumalesh yeligar
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
how to format this "2014-07-14T19:40:46" date to dd-mm-yyyy with time using jstl? please help me...
 
Ulf Dittmer
Rancher
Posts: 42970
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
See the javadocs of the java.text.SimpleDateFormat class - it explains all the options you can use in the pattern.

http://www.coderanch.com/how-to/content/jstl-primer/jstl-fmt-i18n.html shows which JSTL tags to use.
 
Nam Ha Minh
Ranch Hand
Posts: 512
Eclipse IDE Firefox Browser Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thirumalesh yeligar wrote:how to format this "2014-07-14T19:40:46" date to dd-mm-yyyy with time using jstl? please help me...

It's easy to do that with JSTL. Here's a quick example:



Where ${today} points to a variable of type Date available in scope of the JSP page.

For more details, here's an example of formatdate in JSTL.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!