This week's book giveaway is in the Other Open Source APIs forum.
We're giving away four copies of Storm Applied and have Sean Allen, Peter Pathirana & Matthew Jankowski on-line!
See this thread for details.
The moose likes JSP and the fly likes change the date format from db to jsp Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Storm Applied this week in the Other Open Source APIs forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "change the date format from db to jsp" Watch "change the date format from db to jsp" New topic
Author

change the date format from db to jsp

bakiyalakshmi dhanraj
Greenhorn

Joined: Nov 02, 2007
Posts: 24
hi,
In database i have date format in 19/03/2008 while i retrive the value in jsp, i need 19 march 2008 in this format.. can anyone tel me.
pankaj patil
Ranch Hand

Joined: Dec 19, 2004
Posts: 98
Hi

its possibble in 2 ways
1) by converting the date in the db query itself by using to_date
2) by using simpleDateFormat in java


Regards,
Pankaj Patil
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 62513
    
  68

If you are retrieving the date as a Date instance (rather than a string), you can simple use the <fmt:formatDate> JSTL tag on the JSP.


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: change the date format from db to jsp