• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

pls help me Strring to Date

 
Greenhorn
Posts: 17
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
basically
1.
presentation amgetting dd-MM-yyyy fornmat in jsp

2.in action i want to convert in to Date format

string date1 = "14-12-2004"
SimpleDateFormat dat1 = new SimpleDateFormat(dd-MM-yyyy);
java.sql.Date mDate = new java.sqlDate(dat1.parse(date1).getTime());


3.out put am getting 25-05-27(this is outfor .getTime())

4. getDate() in replce the getTime() it says Deprecated.

how do i solve these problems

in prepared Stmt have to insert

stmt.setDate(3,mDate);
 
Ranch Hand
Posts: 1087
Oracle Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
could you tell us what does System.out.println(dat1.parse(date1)); prints.
Can you paste actual code here as Date.getTime is suppose to return a long value and by no means it can output in a format you specified.

Shailesh
 
reply
    Bookmark Topic Watch Topic
  • New Topic