Hello,
I'm trying to determine the "date difference" in days between the current day and a future date selected in a Gambas "DateBox" control.
Can anyone offer the proper syntax for comparing / subtracting two dates?
Thanks kindly in advance
Days between two dates
- BruceSteers
- Posts: 1608
- Joined: Thursday 23rd July 2020 5:20pm
- Location: Isle of Wight
- Contact:
Re: Days between two dates
DateDiff
https://gambaswiki.org/wiki/lang/datediff
https://gambaswiki.org/wiki/lang/datediff
Dim SomeDate As Date
SomeDate = GetFutureDate()
Print DateDiff(Now, SomeDate, gb.Day)
If at first you don't succeed , try doing something differently.
BruceS
BruceS
Re: Days between two dates
In this case you need two DateBoxes.
Specifically you need to use their ".Value" Property, perhaps setting the date manually.
Public Sub Button1_Click()
Print DateBox2.Value - DateBox1.Value
End
Europaeus sum !
Amare memorentes atque deflentes ad mortem silenter labimur.
Amare memorentes atque deflentes ad mortem silenter labimur.
Re: Days between two dates
Bruce and Vuott,
Thanks !
Thanks !