[freetds] mseconds lost when using cs_dt_crack

Fred Romelfanger fred at stsci.edu
Wed May 19 09:28:21 EDT 2004


We found when porting some of our code to freetds that the milliseconds get lost
from the returned data when using cs_dt_crack to break up a timestamp into
a CS_DATEREC data structure.  Here is a context diff for src/ctlib/cs.c as
compared to the file in the freetds repository.


diff -C 5 cs.c.cvs cs.c
*** cs.c.cvs    Wed May 19 09:13:20 2004
--- cs.c        Wed May 19 09:15:39 2004
***************
*** 692,701 ****
--- 692,702 ----
       daterec->datedyear = dr.dayofyear;
       daterec->datedweek = dr.weekday;
       daterec->datehour = dr.hour;
       daterec->dateminute = dr.minute;
       daterec->datesecond = dr.second;
+     daterec->datemsecond = dr.millisecond;
       daterec->datetzone = 0;

       return CS_SUCCEED;
   }



More information about the FreeTDS mailing list