🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #15664

Parsing date strings

#15664
From: Martin Pfeifer
Date: Fri, 07 May 1999 00:00
50 lines
1985 bytes
Dies ist eine mehrteilige Nachricht im MIME-Format.
--------------08289E34A1D622AF437E5BC0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

I tried to write a datevalue into a protocolfile. Later i try to read
the datevalue.

On my system the follwing code produces a date in the wrong format
    Locale.setDefault(Locale.GERMAN);
    System.out.println(new Date());
it prints Thu May 06 17:44:58 CEST 1999 which is definitly not a german
dateformat.

Even better if i try to parse a date in this format it raises an
exception
    Locale.setDefault(Locale.GERMAN);
    try {
        Date test=DateFormat.getDateInstance().parse("Thu May 06
17:44:58 CEST 1999");
    }
    catch(Exception e) {}
raises ParseException

Now, how can i
    a) Produce a date in the german  dateformat ?
    b) Parse a date in the system dateformat as in "Thu May 06 17:44:58
CEST 1999" ?

Any help is appreciated, thanks Martin

--------------08289E34A1D622AF437E5BC0
Content-Type: text/x-vcard; charset=us-ascii;
 name="Martin.Pfeifer.vcf"
Content-Transfer-Encoding: 7bit
Content-Description: Visitenkarte f�r Martin Pfeifer
Content-Disposition: attachment;
 filename="Martin.Pfeifer.vcf"

begin:vcard 
n:Pfeifer;Martin
tel;home:06144 / 2725
tel;work:06145 / 938 124
x-mozilla-html:FALSE
adr:;;;;;;
version:2.1
email;internet:martin.pfeifer@fpg.de
end:vcard

--------------08289E34A1D622AF437E5BC0--
Technical Details
Message-ID: <3732A077.F4C1815E@fpg.de>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,f92f6c2d9d277a57,start
X-Google-Attributes: gidf74b3,public
From: Martin Pfeifer <Martin.Pfeifer@fpg.de>
Subject: Parsing date strings
Date: 1999/05/07
Message-ID: <3732A077.F4C1815E@fpg.de>
X-Deja-AN: 475075699
X-Accept-Language: de
Content-Type: multipart/mixed; boundary="------------08289E34A1D622AF437E5BC0"
Organization: Frost & Partner GmbH
Mime-Version: 1.0
Reply-To: Martin.Pfeifer@fpg.de
Newsgroups: borland.public.jbuilder.java.language