Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

java.sql.Date

 
lu v thuan
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi friends
I have a Date field in Oracle. I use JDBC to get that field.
I would like to display the format like this :mm/dd/yyyy
but in java I can display as :yyyy-mm-dd
I tried to used getMonth(),getDate,getYear() to get the desired
format
Could anyone pls tell me another way ?
Thanks in advanced
 
Peter den Haan
author
Ranch Hand
Posts: 3252
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
new java.text.SimpleDateFormat("MM/dd/yyyy").format(date);
- Peter
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic