Skip to Content.
Sympa Menu

freetds - Re: [freetds] FreeTDS returned data lenght????

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: Michael Peppler <mpeppler AT peppler.org>
  • To: FreeTDS Development Group <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] FreeTDS returned data lenght????
  • Date: Wed, 15 Oct 2003 15:41:22 -0700

On Wed, 2003-10-15 at 15:34, Ole Hansen wrote:
> Hi,
>
> Sorry for the interruption :)
> I an application I do the following when calculating the time as I want
> the time to be represented as UNIX-time used in my application:
>
> DATETIME:
> -------------
> double time;
> u_int32_t days = *((u_int32_t *)value);
> u_int32_t msec = *((u_int32_t *)(value+sizeof(u_int32_t)));
> time = ((double)(days-25567))*24*60*60 + ((double)msec)/1000.0;
>
> The day calculated gives me the expected day but the usec doesnt match.
> This is for CS_DATETIME_TYPE. The calculated value is 8-10 hours behind.

the "msec" value is really 300th of a seconds, not 1000th.

Michael
--
Michael Peppler Data Migrations, Inc.
mpeppler AT peppler.org http://www.mbay.net/~mpeppler
Sybase T-SQL/OpenClient/OpenServer/C/Perl developer available for short or
long term contract positions - http://www.mbay.net/~mpeppler/resume.html




Archive powered by MHonArc 2.6.24.

Top of Page