Days between two dates

Post

Posted
Rating:
#1 (In Topic #1147)
Avatar
Regular
sarpomira is in the usergroup ‘Regular’
 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
Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’
DateDiff
/lang/datediff - Gambas Documentation

Code (gambas)

  1.  
  2. Dim SomeDate As Date
  3. SomeDate = GetFutureDate()
  4.  
  5. Print DateDiff(Now, SomeDate, gb.Day)
  6.  
  7.  
Online now: No Back to the top

Post

Posted
Rating:
#3
Regular
vuott is in the usergroup ‘Regular’

sarpomira said

…… date selected in a Gambas "DateBox" control.
In this case you need two DateBoxes.
Specifically you need to use their ".Value" Property, perhaps setting the date manually.

Code (gambas)

  1. Public Sub Button1_Click()
  2.  
  3.  Print DateBox2.Value - DateBox1.Value
  4.  

Europaeus sum !

<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Regular
sarpomira is in the usergroup ‘Regular’
Bruce and Vuott,

Thanks !   :-)
Online now: No Back to the top
1 guest and 0 members have just viewed this.