aspose file tools*
The moose likes Struts and the fly likes date format Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Frameworks » Struts
Bookmark "date format" Watch "date format" New topic
Author

date format

Rajendra Nath
Greenhorn

Joined: Nov 09, 2005
Posts: 27
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
Bartender

Joined: Oct 29, 2001
Posts: 8909
    
    8

Please do not post the same question more than once. It causes confusion and duplication of effort as the community tries to help everyone.


"blabbing like a narcissistic fool with a superiority complex" ~ N.A.
[How To Ask Questions On JavaRanch]
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: date format