Article View: aus.computers.java
Article #418Re: Formatted date/time via environment variable?
From: Benjamin Johnston
Date: Mon, 09 Oct 2000 00:00
Date: Mon, 09 Oct 2000 00:00
23 lines
1634 bytes
1634 bytes
> Now we are trying to do the same thing in Java. However, try as I might, I > cannot find a Java class that will return the contents of an environment > variable, or a class that will return a formatted date/time string given a > simple format definition string. > > Can anyone suggest a way in which we can elegantly return a formatted > date/time string in Java using our existing environment variable? For some information, read the JavaDocs for; java.lang.System.getenv(String) Note that you could, with a script, turn an environment variable into a property (eg. pass with -D) fairly easily. Also take a look at the class; java.text.SimpleDateFormat I wonder... it probably wouldn't be too hard to transform the format pattern... or you may be lucky; somebody may have already implemented a java.text.DateFormat that is compatible with your format pattern. -Benjamin Johnston s355171@student.uq.edu.au
Technical Details
Message-ID:
<8rrpug$k14$1@bunyip.cc.uq.edu.au>Path:
arc1-ca.pugleaf.net!unknown!not-for-mailReferences:
<39e107db@news.iprimus.com.au>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: 10d6db,e9a2d875ce6c6a1d X-Google-Attributes: gid10d6db,public From: "Benjamin Johnston" <s355171@student.uq.edu.au> Subject: Re: Formatted date/time via environment variable? Date: 2000/10/09 Message-ID: <8rrpug$k14$1@bunyip.cc.uq.edu.au> X-Deja-AN: 679206322 References: <39e107db@news.iprimus.com.au> X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2314.1300 X-Complaints-To: news@uq.edu.au X-Trace: bunyip.cc.uq.edu.au 971074320 20516 172.20.15.103 (9 Oct 2000 06:52:00 GMT) Organization: Benjamin Johnston X-MSMail-Priority: Normal NNTP-Posting-Date: 9 Oct 2000 06:52:00 GMT Newsgroups: aus.computers.java