Article View: borland.public.jbuilder.java.swing
Article #10680Re: system date in japplet
From: Holger Stratmann
Date: Thu, 19 Aug 1999 00:00
Date: Thu, 19 Aug 1999 00:00
29 lines
1440 bytes
1440 bytes
raj wrote:
> hi
>
> is there any way to display system date on japplet
well, although "Date" is mostly deprecated, the following should work
for the near future:
import java.util.Date;
import java.text.DateFormat; //I think...
Date now=new Date();
String display=DateFormat.getDateInstance().format(now);
Then you can do whatever you want with the String - it's should even be
formatted according to the local settings :-))
If you want more than just the date (time, for example *g*), use
DateFormat.getDateTimeInstance() or take a closer look at the
SimpleDateFormat class to format any way you want...
Good luck,
\\///
('O O')
--------------------ooO-(_)-Ooo--------------------
Holger Stratmann
mailto:Holger@cheerful.com
---------------------------------------------------
Technical Details
Message-ID:
<37BB5762.31FE174F@cassiopeia.de>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<37bb5904.0@209.66.99.126>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 111d45,f080312fd5693c80 X-Google-Attributes: gid111d45,public From: Holger Stratmann <hs@cassiopeia.de> Subject: Re: system date in japplet Date: 1999/08/19 Message-ID: <37BB5762.31FE174F@cassiopeia.de> X-Deja-AN: 514443542 Content-Transfer-Encoding: 7bit References: <37bb5904.0@209.66.99.126> X-Accept-Language: en Content-Type: text/plain; charset=us-ascii Organization: Another Netscape Collabra Server User Mime-Version: 1.0 Reply-To: Holger@cheerful.com Newsgroups: borland.public.jbuilder.java.swing