This week's book giveaway is in the General Computing forum. We're giving away four copies of Arduino in Action and have Martin Evans, Joshua Noble, and Jordan Hochenbaum on-line! See this thread for details.
hi i have change this also but then problem is i get 1-Aug-2005 and then if i try to convert this value in java.util.Date or java.sql.Date then the parsing error occurs so thats my problem thanks
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35443
9
posted
0
If you use "MM" for the month it expects a numerical value; if the month is given as text, you need to use "MMM". Check the SimpleDateFormat javadocs - it explains this in more detail. [ August 12, 2005: Message edited by: Ulf Dittmer ]
vikassheel gupta
Ranch Hand
Joined: Aug 02, 2005
Posts: 53
posted
0
hi i used all this now what i am doing is:- String s = "1-Aug-2000";
sqlToday=new java.sql.Date(ts.parse(s).getTime()); } System.out.println(sqlToday); then the out put will be :- 2000-8-1 but didnt get the same result in the formate 1-Aug-2000 i need this value in the java.sql.Date format not in the string this time it is in string thanks alot
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 35443
9
posted
0
i need this value in the java.sql.Date format not in the string this time it is in string
What do you mean, you need it in java.sql.Date format? It is a java.sql.Date. If you want to print it in a specific format, check out the various SimpleDateFormat.format() methods. Printing it using System.out.println will call an objects toString() method, which knows nothing about your preferred format - it uses a default one.
vikassheel gupta
Ranch Hand
Joined: Aug 02, 2005
Posts: 53
posted
0
Hi what i want to do is "1-Aug-1999" in a java.sql.Date formate this time i have this in string so tell me how to do that i did all the ways from my side if u have any other then plsss help me thanks alot