Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

date format

Rajendra Nath
Posts: 27
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all,

SimpleDateFormat dateformat=new SimpleDateFormat("MM-dd-yyyy");
System.out.println("Formated date:"+dateformat.format(dd)); String parsedate=dateformat.format(dd);

which prints this output
Formated date:02-02-2007

i am also using the date picker in a jsp, which prints the date as 2-2-2007.
there is a problem with these date formats. date picker gives the date as 2-2-2007, but the java code gives the date prepending with 0.
can you please help me. as there is a problem with executing the sql query.
Joe Ess
Posts: 9615
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please do not post the same question more than once. It causes confusion and duplication of effort as the community tries to help everyone.
Climb the rope! CLIMB THE ROPE! You too tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
    Bookmark Topic Watch Topic
  • New Topic