🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.api
Article #2486

Re: Formating of Dates in Military Time

#2486
From: Rich Wilkman
Date: Tue, 14 Nov 2000 00:00
23 lines
1348 bytes
Matt:

Unless you can find a specifc locale that uses a 24 hour format (which is not
Military time -- it's just that the US still insists on a 12 hour mechansim),
you'll just have to write a small bit of code that formats the string for you.

Get the hours and minutes from your Date, slap a 0 in front of the hours if
it's less than 9 and concatenate the pieces together for display.

-Rich

Matt Connors wrote:

> Hi,
>
> I have a java.util.Date object and would like to format it in Military time
> (24 hour format) for string output. I figured I'd use the DateFormat object
> but it doesn't seem to produce a string  in 24 hour format. Can anyone out
> there help me ? An example would be very usefull.
>
> Thanks,
>
> Matt
Technical Details
Message-ID: <3A117369.3299520A@formlessvoid.com>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <3a116172$1_1@dnews>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: 1089d0,5ae111b47b541898
X-Google-Attributes: gid1089d0,public
From: Rich Wilkman <richw@formlessvoid.com>
Subject: Re: Formating of Dates in Military Time
Date: 2000/11/14
Message-ID: <3A117369.3299520A@formlessvoid.com>
X-Deja-AN: 693548276
Content-Transfer-Encoding: 7bit
References: <3a116172$1_1@dnews>
X-Accept-Language: ja,en
Content-Type: text/plain; charset=us-ascii
X-Trace: 14 Nov 2000 09:18:14 -0800, 209.144.169.10
MIME-Version: 1.0
Reply-To: richw@formlessvoid.com
Newsgroups: borland.public.jbuilder.java.api