Skip to Content.
Sympa Menu

freetds - RE: DBLIB Unit Tests failing again

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Thompson, Bill D (London)" <ThompBil AT exchange.uk.ml.com>
  • To: "'TDS Development Group'" <freetds AT franklin.oit.unc.edu>
  • Subject: RE: DBLIB Unit Tests failing again
  • Date: Tue, 17 Sep 2002 09:41:24 +0100


Guys,

Somehow I KNEW I didn't want to open up this can of worms about date
formats.
I've had a sleepless night thinking about this, so let me tell you what I've
decided to do (with everyone's agreement of course)...

The status quo, as far as it goes, is fine. Out of the box, our dblib and
ctlib convert functions output the same date string formats as their
official (Sybase) counterparts. If you want something different, you can
override these formats (globally) using freetds.conf . I think the vast
majority of users will be happy with that level of flexibility.

However, I do need to be absolutely sure in bcp that date data being output
in character format captures seconds and milliseconds regardless of
configuration, so I need to be able to override the default/configured date
formats.

I propose to more closely integrate my tds_datecrack() function (which
decomposes a SYBDATETIME/4 into a "tm" like structure), with James'
tds_strftime() function (which takes a slightly different "tm" like
structure as input), so that the ouput of the first can be used as the input
of the second. This will have a number of advantages:

1) I can encapsulate all "date cracking" code into the one function.
Currently this is replicated in tds_convert_datetime() and
tds_convert_datetime4().

2) It will be easy to convert a SYBDATETIME to any format you like by
calling tds_datecrack and then calling tds_strftime passing in the format of
your choice.

I'll then put the code into the bcp code to do this instead of calling
dbconvert() for datetime columns.
I also thought I could pass in a slightly different date format depending on
whether MSDBLIB is defined, to yield "2001-09-11..." instead of "Sep 11
2001..."

Whaddaya reckon ?

Bill






Archive powered by MHonArc 2.6.24.

Top of Page