Article View: borland.public.jbuilder.java.language
Article #19147Re: Date type to/from string
From: Tad Frysinger
Date: Wed, 11 Mar 1998 00:00
Date: Wed, 11 Mar 1998 00:00
29 lines
1322 bytes
1322 bytes
In article <3505D755.B6F361B@ForAWhile.com>, Broken@ForAWhile.com says...
> Tad Frysinger wrote:
>
> > Any other ideas?
> >
>
> use the Calendar and/or GregorianCalendar classes.
>
> you can do this sort of thing:
>
> Date myDate = new Date();
> SimpleDateFormat df = new SimpleDateFormat("EEE MMM dd HH:mm:ss
> yyyy");
> String myStringDate = df.format(myDate);
>
> with the classes mentioned above, you can reconstruct myStringDate into
> a date.
>
> Jim
>
>
>
Well, maybe I missed something, but I was all over Calendar and
GregorianCalendar, and didn't see a way to construct a *Date* from a
string (the default toString() method of Date uses a formatter very
similar to what you posted).
I'll look again.
Technical Details
Message-ID:
<MPG.f706587e964244a9897cf@forums.borland.com>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<MPG.f6f3422293a76d09897c7@forums.borland.com> <35059639.B429F072@csi.com> <MPG.f6f7f045dce2f2d9897cb@forums.borland.com> <3505D755.B6F361B@ForAWhile.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: f74b3,97ec465ac7d926cb X-Google-Attributes: gidf74b3,public From: tfrysinger@earthlink.net (Tad Frysinger) Subject: Re: Date type to/from string Date: 1998/03/11 Message-ID: <MPG.f706587e964244a9897cf@forums.borland.com> X-Deja-AN: 333011813 References: <MPG.f6f3422293a76d09897c7@forums.borland.com> <35059639.B429F072@csi.com> <MPG.f6f7f045dce2f2d9897cb@forums.borland.com> <3505D755.B6F361B@ForAWhile.com> Organization: FreeZone Enterprises Newsgroups: borland.public.jbuilder.java.language