Skip to Content.
Sympa Menu

freetds - RE: [freetds] Locale specific problem

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Lowden, James K" <LowdenJK AT bernstein.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: RE: [freetds] Locale specific problem
  • Date: Thu, 12 Aug 2004 11:24:08 -0400

> From: Simon
> Sent: Thursday, August 12, 2004 8:35 AM
>
> I did some experimenting, and would suggest adding this to the locale.conf:
>
> [pt_BR]
> date format = %d/%m/%Y %H:%M

OK. The attached patch just adds a default language and character set.

> I wonder why the default wouldn't be "%Y-%m-%d %H:%M". This is how it
> shows up in my Query Analyzer

http://www.freetds.org/faq.html#dateformat :-)

I'm still not sure why your dates didn't have am/pm attached to them, though.


--jkl

-----Mensagem original-----
De: freetds-bounces AT lists.ibiblio.org em nome de James K. Lowden
Enviada: qua 11/8/2004 19:31
Para: FreeTDS Development Group
Cc:
Assunto: Re: [freetds] Locale specific problem


On Tue, 10 Aug 2004 <simon AT magazineluiza.com.br> wrote:
>
> I believe I have a bug in freetds's date-time formatting. The locale on
> my box is ...;LC_TIME=pt_BR;...
>
> 12:00 is shown as 12:00 and 12:00PM is shown as 12:00... i.e. I can´t
> differentiate between AM and PM. For this locale, it would be normally
> shown as 00:00-23:59.

Hi Simon,

Welcome to the project.

FreeTDS uses strftime(3) to format date strings:

size_t
strftime(char * restrict buf, size_t maxsize,
const char * restrict format,
const struct tm * restrict timeptr);

The format string is taken from locales.conf. There is a built-in default
if its not found, one for each client library (because historically each
has had its own default format). Are you perhaps using ODBC? Cf. 4
odbc.c, line 1034. Else grep for date_fmt.

Probably all you need to do is add a section for pt_BR to locales.conf.
If that doesn't do the trick, please show the output of the attached
little program.

Regards,

--jkl

-----------------------------------------
The information contained in this transmission may contain privileged and
confidential information and is intended only for the use of the person(s)
named above. If you are not the intended recipient, or an employee or agent
responsible for delivering this message to the intended recipient, any
review, dissemination, distribution or duplication of this communication is
strictly prohibited. If you are not the intended recipient, please contact
the sender immediately by reply e-mail and destroy all copies of the original
message. Please note that we do not accept account orders and/or instructions
by e-mail, and therefore will not be responsible for carrying out such orders
and/or instructions.
If you, as the intended recipient of this message, the purpose of which is to
inform and update our clients, prospects and consultants of developments
relating to our services and products, would not like to receive further
e-mail correspondence from the sender, please "reply" to the sender
indicating your wishes. In the U.S.: 1345 Avenue of the Americas, New York,
NY 10105.

Attachment: locales.diff
Description: locales.diff




Archive powered by MHonArc 2.6.24.

Top of Page