• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

using jstl to format date and time

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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...
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.

https://coderanch.com/how-to/content/jstl-primer/jstl-fmt-i18n.html shows which JSTL tags to use.
 
Ranch Hand
Posts: 530
Hibernate Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic