I'd avoid playing around with the string. That's a lot of work.
An example I read somewhere talked about how the mm/dd/yyyy format is
instantiated easily using:
(Locale named: #C) readDateFrom: aReadStream
Where aReadStream would be created by sending #readStream to your date
string like:
(Locale named: #C) readDateFrom: '02/21/2004' readStream
I know your's isn't #C, but I don't know which it might be. To find out
which locales were loaded into my image:
Locale allLocaleObjects
But if you know how your date are coming in and want them to be d/m/y,
you could just do:
(Locale named: #'nl_D.ISO8859-1') readDateFrom: '14/11/2003' readStream
I'm guessing nl is Netherlands. The above returns 'November 14, 2003'
when sent #longPrintString.
Post by Aby MathewFor the time being I could not change the locale as I want but I have found
another way. Is it a good thing to accept the date as a string and then
interchange the month and date and then pass it to the database. Its a bit
crude but it works. Anybody with any other ideas.
Aby
Post by Magnus JaktYou want to read the Internationalization Guide (InternationalGuide.pdf),
which will tell you how (you want to look at Locale and the methods
available there).
Post by Magnus JaktHowever, I found that I had some sort of problem with resetting the Locale
on my system (I forgot what, maybe some environment variable was wrong or
something), so I ended up changing the default locale to print dates the way
I wanted. In particular you want to look at the TimestampPrintPolicy class
and its related methods. I just choose one of the initialize methods that
were closest to what I wanted, created a new one with my changes and had
that be called on Locale initialization.
Post by Magnus JaktHope this helps,
Magnus
Post by Aby MathewHi
I want to accept date in dd/mm/yyyy format but after two days am still
not
Post by Magnus JaktPost by Aby Mathewable to do it. I am able to display date in this format but in the case
of
Post by Magnus JaktPost by Aby Mathewaccepting a date when the focus comes on the accepting field the date
format
Post by Magnus JaktPost by Aby Mathewturns to mm/dd/yyyy. Somebody help me with this. It may seem simple but
help
Post by Magnus JaktPost by Aby Mathewwould be highly appreciated.
Aby
--
Magnus Jakt
(Remove the obvious from the return address when replying)
--
.tom
remove email address' dashes for replies
opensource middleware at <http://isectd.sourceforge.net>
http://gagne.homedns.org