| Register | FAQ | Calendar | Search | Today's Posts | Mark Forums Read |
|
#1
| |||
| |||
| Dear developers, There is changelog entry: >2008-07-25 13:15 UTC+0100 Jose F. Gimenez <jfgimenez/at/wanadoo.es> > * source/rtl/dateshb.c > + function TTOD( <datetime> ) -> <dateonly> > * source/rtl/win32ole.prg > % Allow a pointer passed to TOleAuto():New(), treating it as a pointer to idispatch, > just like in case of numeric > % Avoid precision faults in reading datetime values from ole and in win32ole.prg module after call to hb_itemPutDTD there is lines pItem->item.asDate.time++; I suppose instead of this in module source\common\hbdate.c function hb_datetimeUnpack() change lines dTime *= (double)(86400 * HB_DATETIMEINSEC); *plTime = (LONG)dTime; to dTime *= (double)(86400 * HB_DATETIMEINSEC); *plTime = (LONG)(dTime + 0.5); to force rounding double values to long (not truncating). This solves precision faults problems after floating point operations. Best regards, Saulius |
|
#2
| |||
| |||
| Saulius This simple sting works just fine for me : oRs:Fields("lastlogDt"):Value := dtoc(DATE())+" "+time() Rick Lipkin On Aug 14, 7:51*am, "Saulius" <Saul...@NOSPAM.com> wrote: > Dear developers, > > There is changelog entry: > > >2008-07-25 13:15 UTC+0100 Jose F. Gimenez <jfgimenez/at/wanadoo.es> > > ** source/rtl/dateshb.c > > * *+ function TTOD( <datetime> ) -> <dateonly> > > ** source/rtl/win32ole.prg > > * *% Allow a pointer passed to TOleAuto():New(), treating it as a pointer to idispatch, > > * * *just like in case of numeric > > * *% Avoid precision faults in reading datetime values from ole > > and in win32ole.prg module after call to hb_itemPutDTD there is lines > > * * * pItem->item.asDate.time++; > > I suppose instead of this in module source\common\hbdate.c > function hb_datetimeUnpack() change lines > > * * * dTime **= (double)(86400 * HB_DATETIMEINSEC); > * * * *plTime = (LONG)dTime; > > to > > * * * dTime **= (double)(86400 * HB_DATETIMEINSEC); > * * * *plTime = (LONG)(dTime + 0.5); > > to force rounding double values to long (not truncating). > This solves precision faults problems after floating point operations. > > Best regards, > Saulius |
![]() |
| Thread Tools | |
| Display Modes | |
In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.