🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.swing
Article #11688

Re: converting to date format

#11688
From: Jason Burton
Date: Mon, 19 Apr 1999 00:00
16 lines
996 bytes
Alex Tavera V. <taveraa@ucbcba.edu.bo> wrote in message
news:7ffji3$shj9@forums.borland.com...
> Hi, I have a string like this '19990405'
> How can I convert this string to a date format?
>
> Thanks.

Assuming that you absolutely KNOW the date is coming in that way, you can
use:

SimpleDateFormat format = new SimpleDateFormat("yyyyMMdd");
Date result = format.parse("19990405", new ParsePosition(0));

Hope this helps,
Jason
Technical Details
Message-ID: <7ffnqq$smm7@forums.borland.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <7ffji3$shj9@forums.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,c806068ffd51c5d8
X-Google-Attributes: gid111d45,public
From: "Jason Burton" <Jason.Burton@McLeodSoftware.com>
Subject: Re: converting to date format
Date: 1999/04/19
Message-ID: <7ffnqq$smm7@forums.borland.com>
X-Deja-AN: 468366273
References: <7ffji3$shj9@forums.borland.com>
X-Priority: 3
X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300
Organization: Another Netscape Collabra Server User
X-MSMail-Priority: Normal
Newsgroups: borland.public.jbuilder.java.swing