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

date inserting

sandeep balyan
Ranch Hand

Joined: Jul 25, 2001
Posts: 134
Hello friends
iam having a problem for date
Iam checking in form for a input if input is Yes than insert date if NO than insert null..I tried lots of things but error is coming Not a date format if I insert null...
can any one tell how is this possible..
sandeep


Want to do something great will do one day
kalyan
Greenhorn

Joined: Jan 22, 2002
Posts: 5
hi sandeep
u have to format the date
u have to capture the date and format in the required format as desired by thru SIMPLE DATE FORMAT and then store it to database i think the following peice of code will help u
java.util.Date MyDate=new java.util.Date(YourDate);
SimpleDateFormat sdf=new SimpleDateFormat("your desired format like dd/MM/yyyy");
String DateToBeStored=sdf.format(MyDate);

and i think if you do not want the date in a particular format u can directly store the SYSdate without formating but i didnt try that.just try that
GOOD LUCK
KALYAN
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: date inserting