🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: Newbie Date question (but trickier than it looks)

#305
From: Hugh Jones
Date: Tue, 04 Oct 2005 15:22
44 lines
2629 bytes
Gillmer J. Derge [TeamB] wrote:
> Are you converting the date to a string yourself, or is 
> this 3rd party library formatting it?  If you're doing it, then Arthur 
> Ore's idea should work.  Can you possibly post a short example of the 
> code you're using?  It might help clarify the situation.
>

I am not performing any date manipulation or conversion at all.

It is quite complicate to explain, but essentially I have an xml file 
and a Documentum (Oracle) Database.

The format of the xml is correct, and cannot be changed, since it has to 
correspond to the server format, which happens to be 'dd/MM/yyyy'.

The API call (client side) is naturally reading the xml in default Locale.

The OS setting on the client, however, *can be* different from the 
server.  When I first ran this the 3rd party API call fell over because 
the OS was set to 'yyyy-MM-dd'.

I can make the routine work by going into control panel and making sure 
the Client OS has 'dd/MM/yyyy', but this strikes me as being inherently 
crappy.

Ideally I want to make sure that anyone running this at a later date can 
run it without recourse to a README.  I sort of assumed that something like

---

applyTemporaryLocale();
try {
   documentumThingy.import();
} finally {
   restoreDefaultLocale();
}

---

would be a breeze, if only I could find the right methods. This is 
something I would regularly do in Delphi. (and yes, I know that is a bad 
attitude)

It looks like this is not possible in java.  Do you agree ?
Technical Details
Message-ID: <43429dbf$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail
References: <434142fe$1@newsgroups.borland.com> <43414798$1@newsgroups.borland.com> <434230c1@newsgroups.borland.com> <43428921$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,597975fc8535d7af
X-Google-Attributes: gidf74b3,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Tue, 04 Oct 2005 16:22:42 +0100
From: Hugh Jones <Hugh.Jones@No_spammmers_Mail.Thomson.com>
User-Agent: Mozilla Thunderbird 1.0.2 (Windows/20050317)
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language
Subject: Re: Newbie Date question (but trickier than it looks)
References: <434142fe$1@newsgroups.borland.com> <43414798$1@newsgroups.borland.com> <434230c1@newsgroups.borland.com> <43428921$1@newsgroups.borland.com>
In-Reply-To: <43428921$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 81.144.179.98
Message-ID: <43429dbf$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1128439231 81.144.179.98 (4 Oct 2005 08:20:31 -0700)
Lines: 44
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!newsfeed.gamma.ru!Gamma.RU!newsfeed.media.kyoto-u.ac.jp!newsfeeds.ihug.co.nz!ihug.co.nz!newsgroups.borland.com!not-for-mail