Article View: borland.public.jbuilder.java.language
Article #19723Re: dates - invalid conversion!!
From: Noah Clements
Date: Sat, 20 Dec 1997 00:00
Date: Sat, 20 Dec 1997 00:00
49 lines
1657 bytes
1657 bytes
Hi, you may have moved on, but...
Try printing the time as well as the day in your test. I have the
feeling that the problem may be traced to timezone conversions where
you weren't expecting any.
Noah
>I have noticed this too. All of the date class documentation states that
>days start from 1-31. However, whenever you run it through a format
>class, it looses a day. I thing the Date class starts at one, but the
>SimpleDateFormat class starts at zero.
>
>Just a hunch...either way it is a bug!
>
>Kurt
>
>
>Bryan Chalmers wrote:
>
>> I have the following piece of code is supposed to format a date (d) as
>> dd/mm/yyy
>>
>> System.out.println("date before is " + d);
>> SimpleDateFormat df = new SimpleDateFormat("dd/MM/yyyy");
>> System.out.println("date after is " + df.format(d));
>>
>> This gives the following output.
>> date before is 1958-11-20
>> date after is 19/11/1958
>>
>> I seem to have lost a day in the conversion. Can anyone tell me what I
>> am doing wrong?
>>
>> Regards,
>> Bryan Chalmers
>> Texaco North Sea (UK) Company
>> Aberdeen
>> chalmbr@texaco.com
>
>
>
>--
>
>
>Kurt A. Zarefoss
>hawk@fred.net
>
>
Technical Details
Message-ID:
<349b8bc1.21464107@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<3460a708.11625096@forums.borland.com> <3460B61B.7B55105A@my.signature>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,aa85914ad822cd30 X-Google-Attributes: gidf74b3,public From: DELETE_THIS.2clem@concentric.net (Noah Clements) Subject: Re: dates - invalid conversion!! Date: 1997/12/20 Message-ID: <349b8bc1.21464107@forums.borland.com> X-Deja-AN: 308810063 References: <3460a708.11625096@forums.borland.com> <3460B61B.7B55105A@my.signature> Organization: None Newsgroups: borland.public.jbuilder.java.language