Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Java > Java and JDK > JSP Basics
|
JSP Basics Beginning-level questions on JSP. More advanced coders should post to Pro JSP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the JSP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old September 25th, 2005, 01:50 AM
Registered User
 
Join Date: Sep 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Saving Date problem

Hi,
I am trying to save some fields in a table, one field with type Date. It only accepts date with the following format (01-Jan-05). I am reading the date as a string (24/09/2005) and then convert it to date.
But i do not know to convert it to the following format (24-Sep-05) to store it in the table?? Please I need help urgently. This is my code :
<%
String issuedate = request.getParameter("issuedate");
DateFormat format = new SimpleDateFormat("dd/MM/yyyy");
myIssueDate = format.parse(issuedate);
mindecree.setIssueDate(new java.sql.Date(myIssueDate.getTime()));
%>

Note:I've tried using the following:
SimpleDateFormat format = new SimpleDateFormat("dd-MMM-yy"); Date myIssueDate = format.parse(issuedate);
But i got (Unparseable date:"19/5/2005" ) error .
Any Idea pls.???






Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with saving a file nelly78 .NET Framework 2.0 3 October 24th, 2008 01:09 AM
Image saving problem OLEDB aliirfan84 ASP.NET 2.0 Professional 0 June 25th, 2007 06:28 AM
.Net File Saving Problem vinod_pawar1 General .NET 1 July 4th, 2004 09:30 PM
problem while saving the excel sheet icyindian Pro VB 6 3 September 20th, 2003 01:33 AM
Saving Date value stephanel SQL Language 5 August 22nd, 2003 10:11 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.