[Gambas-user] datediff to miliseconds

Gianluigi bagonergi at gmail.com
Tue May 14 00:15:55 CEST 2019


Quite right,
Print CLong((DateDiff(dData2, dData1, gb.Second))) * 1000
work fine, thank you

Regards
Gianluigi

Il giorno lun 13 mag 2019 alle ore 23:43 Jussi Lahtinen <
jussi.lahtinen at gmail.com> ha scritto:

> 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 ]----
>>
>
> ----[ 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/f84de316/attachment.html>


More information about the User mailing list