Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2009-05

Re: daysbetween

1 message · 1 person ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Seth Grover

Disregard my email about daysbetween, I just saw this:

http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/objpas/dateutil.inc?view=diff&r1=12958&r2=13107

-SG

This email is fiction. Any resemblance to actual events or persons living or dead is purely coincidental. Seth Grover sethdgrover[at]gmail[dot]com On Wed, May 6, 2009 at 2:11 PM, Seth Grover wrote: > http://svn.freepascal.org/cgi-bin/viewvc.cgi/trunk/rtl/objpas/dateutil.inc?view=diff&r1=12957&r2=12958 > shows that a change was recently made which replaces "Trunc" with > "Round" in the *Between routines in dateutil.inc (DaysBetween, > HoursBetween, etc.). > > So this program: > --------------------------------- > > program Project1; > > {$mode objfpc}{$H+} > > uses >  Classes,SysUtils,DateUtils; > > var >  val1, val2 : TDateTime; > begin >  val1 := 39939.0; >  val2 := 39939.796069305557; >  writeln(DaysBetween(val1, val2)); > end. > --------------------------------- > > Will now print result in a "1" instead of a "0" which is what I would > have gotten before. > > Now I know I can just use trunc(DaySpan(val1, val2)) to achieve the > same result, but I was just curious as to why this change was made > which so drastically changes the functionality of these calls. > > Thanks, > > -SG > > -- > This email is fiction. Any resemblance to actual events > or persons living or dead is purely coincidental. > > Seth Grover > sethdgrover[at]gmail[dot]com >

Reply by email