This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
hi, how do you make a calendar or a date object from a string variable like "1 Jan 2001"? I want to use this object in a sql query against a microsoft sql database with a datetime column. many thanks
If you consult the documentation, you will see that DateFormat.SHORT is expected to be completely numeric, so obviously it is not a good candidate here. DateFormat.MEDIUM is more likely to work for you, but it depends on the Local used, and the exact format used is not documented. Your best best is to use SimpleDateFormat instead: <pre>DateFormat df = new SimpleDateFormat("dd MMM yyyy");</pre> This allows you to more explicitly control the format used.