Discussions

Web tier: servlets, JSP, Web frameworks: change sql date to simpledateformat (mm/dd/yyyy)

  1. Hi All, I am retrieving date from the database in the following format : 2006-08-09 09:12:14:0 I have to change it in the mm/dd/yyyy format .. How can I do it in java answer please Thanks
  2. Try this: select to_char(date_field, 'mm/dd/yyyy') from your_table
  3. use the following steps SimpleDateFormat sdfOutput = new SimpleDateFormat("MM/dd/yyyy"); String date= sdfOutput.format();