Solved

Problem when convert string to date (invalid day of Feb)

Posted on 2009-04-09
1
223 Views
Last Modified: 2013-11-23
Hi experts!

I met a problem when convert a string to date. Pls help, many thanks!
When input string represents a date with February month, invalid day of month (29 or 30, 31,..), it's automatically converted to March and day of month is (invalid input day of month - 28 (or 29)).
For example, input string "31/2/2009" will be converted to "3/3/2009"
SimpleDateFormat ts= new SimpleDateFormat("dd/MM/yyyy");
ava.sql.Date retDate = new java.sql.Date(ts.parse(inpCell.getContents()).getTime());

Open in new window

0
Comment
Question by:ncsvietnam
1 Comment
 
LVL 92

Accepted Solution

by:
objects earned 500 total points
ID: 24113192
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
groupSumClump challenge 9 115
topping3 challenge 14 79
firstswap challenge 20 77
factorial example 4 39
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.

813 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now