reformatting dates using hibernate

Posted on 2005-03-29
Medium Priority
Last Modified: 2013-11-24
I have a following mapping in hibernate:
<property name="poDate" column="PO_DATE" type="date"  not-null="true" />

Currently if I do this: <c:out value="${po_record.poDate}"/> , the page renders this:  2006-01-31
I'd like it to display this, instead: 01/31/2006

What's the best way to do that?
Question by:aturetsky
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 86

Accepted Solution

CEHJ earned 500 total points
ID: 13654440

Author Comment

ID: 13654565
Thanks, CEHJ, that link was very useful.  I would prefer to do it in hibernate, though, since that field would always need to render that way throughout the app.

Author Comment

ID: 13654593
just saw your answer to my other question - so you think this one should be handled in jsp as well, even though it will always display the same?
LVL 86

Expert Comment

ID: 13654699
Definitely. The format is a view issue, not a model one. Dates are stored as numbers in the model
LVL 86

Expert Comment

ID: 13684302

Featured Post

Stack Overflow Podcast - Frustrating Miracles

In this podcast, Stack Overflow interviewed Linux Academy CEO/Founder, Anthony James, and got his developer story!

"Follow your passion, be prepared to work hard and sacrifice, and, above all, don't let anyone limit your dreams."  - Donovan Bailey

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For beginner Java programmers or at least those new to the Eclipse IDE, the following tutorial will show some (four) ways in which you can import your Java projects to your Eclipse workbench. Introduction While learning Java can be done with…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
This theoretical tutorial explains exceptions, reasons for exceptions, different categories of exception and exception hierarchy.
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses
Course of the Month14 days, 18 hours left to enroll

771 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question