🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Default Date formate YYYY-MM-DD

#8638
From: Ronald Wildenberg
Date: Mon, 05 Mar 2001 07:13
20 lines
1272 bytes
Hi Stephen,

You can use SimpleDateFormat:

SimpleDateFormat dateFormatter =
    new SimpleDateFormat ("yyyy-MM-dd HH:mm:ss");

String dateString = dateFormatter.format (new Date());

Ronald.

stephen wrote:

> How to formate to date to YYYY-MM-DD 2001-1-1
> and YYYY-MM-DD HH:MI:SS 2001-1-1 10:30:33
>
> OR any way to set default date format to above?
>
> Stephen
> Thanks
Technical Details
Message-ID: <3AA33C8F.EAF09CFF@tryllian.com>
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!194.25.134.62!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!bornews.borland.com!dnews!62.58.162.210
References: <3aa33732_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f74b3,51d314d4595bb609
X-Google-Attributes: gidf74b3,public
X-Google-ArrivalTime: 2001-03-04 23:13:57 PST
Message-ID: <3AA33C8F.EAF09CFF@tryllian.com>
Date: Mon, 05 Mar 2001 08:13:19 +0100
From: Ronald Wildenberg <ronald@tryllian.com>
X-Mailer: Mozilla 4.75 [en] (Windows NT 5.0; U)
X-Accept-Language: en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language
Subject: Re: Default Date formate YYYY-MM-DD
References: <3aa33732_2@dnews>
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 62.58.162.210
X-Trace: 4 Mar 2001 23:11:17 -0800, 62.58.162.210
Lines: 21
Path: arc1-ca.pugleaf.net!supernews.google.com!sn-xit-02!supernews.com!news.tele.dk!194.25.134.62!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!bornews.borland.com!dnews!62.58.162.210