freetds AT lists.ibiblio.org
Subject: FreeTDS Development Group
List archive
- From: Brian Bruns <camber AT ais.org>
- To: TDS Development Group <freetds AT franklin.oit.unc.edu>
- Subject: Re: dbconvert function in db-lib
- Date: Wed, 5 Dec 2001 07:49:37 -0500 (EST)
On Wed, 5 Dec 2001, Bill Thompson wrote:
> Hey Guys,
>
> Will this function convert a date held as a SYBCHAR in the format "Dec 5
> 2001 10:34:47:506AM" (the default character output format of a date using
> Sybase bcp -c) , into the SYBDATETIME format ?
>
> I've tried looking at tds/convert.c , but the code is WAY too clever for
> me :-)...
_string_to_tm parses a character, if it's a digit it gets added to a field
after that field being multiplied by 10, if it's not a digit the field is
incremented. So, the code will handle:
12/01/2001 12:43 or
12-01-01-12:43 or even
12!01!2001/12/43 (i don't know who writes dates this way, but the code
attempts to be lenient)
but nothing with character fields (month names, AM/PM designator etc..)
the code is really a quick hack and needs to be replaced by something a
bit more robust. It is also not internationalized at all.
> P.S. dblib bcp work is still going well.
Good to hear.
Cheers,
Brian
-
dbconvert function in db-lib,
Bill Thompson, 12/05/2001
- <Possible follow-up(s)>
- Re: dbconvert function in db-lib, Brian Bruns, 12/05/2001
- Re: dbconvert function in db-lib, Bill Thompson, 12/05/2001
Archive powered by MHonArc 2.6.24.