🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How do I display the system date

#8284
From: Kevin Dwan
Date: Thu, 28 Sep 2000 00:00
20 lines
1096 bytes

alex wrote:

> Hi all,
>    How can I display the current date. Pls help??
> Thanks
>
> Regards,
> Alex

In a reply to a person asking how to get the date as an int, posted to
public.jbuilder.java.lang, John McGrath of TeamB suggested this code,
which you should be able to adapt to your purpose.

Calendar calendar = Calendar.getInstance();
    calendar.setTime( new Date() );
    int year = calendar.get( Calendar.YEAR );
    int month = calendar.get( Calendar.MONTH );
    int day = calendar.get( Calendar.DAY_OF_MONTH );
Technical Details
Message-ID: <39D38E61.D1D88087@blueberry.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <39d319c7_2@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 111d45,410182b4cd3f3dbc
X-Google-Attributes: gid111d45,public
From: Kevin Dwan <kevin@blueberry.com>
Subject: Re: How do I display the system date
Date: 2000/09/28
Message-ID: <39D38E61.D1D88087@blueberry.com>
X-Deja-AN: 675215564
Content-Transfer-Encoding: 7bit
References: <39d319c7_2@dnews>
X-Accept-Language: en
Content-Type: text/plain; charset=us-ascii
Organization: Another Netscape Collabra Server User
Mime-Version: 1.0
Newsgroups: borland.public.jbuilder.java.swing