[Lazarus] DateDif function needed
Lukasz Sokol
el.es.cr at gmail.com
Wed Nov 13 09:44:32 CET 2013
On 12/11/13 22:52, Bart wrote:
> On 11/12/13, waldo kitty <wkitty42 at windstream.net> wrote:
>
>> you do not need any of the above if you change
>>
>>> Days := (DaysPerMonth(M1, IsLeapYear(Y2)) - D1) + D2 ;
>>
>> to
>>
>> Days := (DaysInAMonth(Y2,M1) - D1) + D2;
>>
>
> I did not know about DaysInAMonth.
> I just went coding and created that function because I needed it.
>
> I can see it uses the exact kind of logic I did...
>
>> outside of this, what you came up with is almost exactly what i worked my
>> way
>> down to as i was working on my own solution... it took me a while and then
>> when
>> i saw your post, i was astonished at how the mind works at times :LOL:
>
> Yes, nice.
>
> Hope anyone actually can use this.
>
> Bart
>
> --
I vote for this to be accepted into (FP)DateUtils unit.
-L.
More information about the Lazarus
mailing list