[Gambas-user] datediff to miliseconds

Jussi Lahtinen jussi.lahtinen at gmail.com
Mon May 13 23:42:30 CEST 2019


It's still integer...

Jussi

On Mon, May 13, 2019 at 9:10 PM Gianluigi <bagonergi at gmail.com> wrote:

> 611085255000 I think it is normal that it gives error being superior to
> 2147483647 (max of integer).
> But I don't understand why this code returns 1200394968 instead of
> 611085255000:
>
>   Dim dData1 As Date = Now
>   Dim dData2 As Date = "01/01/2000"
>   Dim i As Integer
>
>   Print DateDiff(dData2, dData1, gb.Second)
>   Try DateDiff(dData2, dData1, gb.Millisecond)
>   If Error Then
>     Print DateDiff(dData2, dData1, gb.Second) * 1000
>   Else
>     DateDiff(dData2, dData1, gb.Millisecond)
>   Endif
>
> Regards
> Gianluigi
>
> Il giorno lun 13 mag 2019 alle ore 18:21 gen braga <genbraga1 at gmail.com>
> ha scritto:
>
>> Hi there,
>>
>> in the below code:
>>
>>   Dim dData1 As Date = Now
>>   Dim dData2 As Date = "01/01/2000"
>>
>>   Print DateDiff(dData2, dData1, gb.Second)
>>   Print DateDiff(dData2, dData1, gb.Millisecond)
>>
>> is there anything wrong? I got an overflow when printing milliseconds
>>
>> -
>> Gen
>>
>> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>>
>
> ----[ Gambas mailing-list is hosted by https://www.hostsharing.net ]----
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20190514/1b468cfd/attachment-0001.html>


More information about the User mailing list