Re: simpleDateFormat and April month

From: Paul Lutus (nospam_at_nosite.zzz)
Date: 09/16/04


Date: Thu, 16 Sep 2004 10:45:20 -0700

Nurettin Arslankaya wrote:

> Hi,
>
> possibly, i had a bug to report. Here is sample code to test :
>
> public Date StrToDate(String DT) throws Exception {
> SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd
> HH:mm:ss");
> return formatter.parse(DT);
> }

That is not all the code you are using in your test. Please post a complete,
short, working program.

> When I test with fallowing data I got wrong result.
>
> 1980-04-01 00:00:00 returns 1980-04-01 01:00:00

Using what output routine?

> 1975-04-12 00:00:00 returns 1975-04-12 01:00:00
>
> for the dates It works wrong for 1 hour. when you enter 1980-04-01
> 01:00:00 it works correct but if you enter 1980-04-01 00:30:00 it
> returns also 1 hour later time.
>
>
> possibly there are several dates that has problem. I am using jre 1.4.
> Does anyone know why it resulting wrong.

No, no one knows. Why? You did not post your code.

-- 
Paul Lutus
http://www.arachnoid.com