Una cosina semplice, semplice non andrebbe meglio?
Public Sub dbxEnd_Change()
Dim i As Integer
i = DateDiff(dbxStart.Value, dbxEnd.Value, gb.Day)
TextLabel1.Text = "<b>" & CStr(i) & " giorni"
End
:ciao:
P.S. Mi sorge il dubbio che tu voglia sommare i giorni ad una data, allora in quel caso devi usare DateAdd (http://gambaswiki.org/wiki/lang/dateadd)
Ciao hai provato semplicemente :
ValueBox1.Value = Now
Label1.Text = Format(CDate(Now - 90), "dd/mm/yyyy")
:ciao:
Ciao ho provato anche usando .....
Public Sub Button1_Click()
Label5.Text = Format(CDate(ValueBox1.Value - 10), "dd/mm/yyyy")
End
e sembra funzionare :ciao: ;D
Se io ho aperto un progetto come "Command-line application":
Public Sub Main()
Print "Hello world"
End
non posso utilizzare l'oggetto "ValueBox"....
...sono stato chiaro ?
La butto li: probabilmente si dovrebbe usare un'interfaccia a linea di comando magari utilizzando il componente gb.ncurses e fare in modo di intercettare i dati da tastiera forse creando una maschera tipo "__/__/____" .
:rolleyes:
..basterebbe provare ad utilizzare le funzioni di data e tempo :-\
Due ipotesi potrebbero essere le seguenti:
Public Sub Main()
Print Format(CDate(CDate("08/21/1969 23:59:59") - 10), "dd/mm/yyyy")
Print Format(CDate(Date(1969, 08, 21, 0, 0, 0, 0) - 10), "dd/mm/yyyy")
End
:-X
Di questo che vi pare?
Public Sub Main()
Dim a, b As Date
a = CDate(Val("1/1/17") - 10)
b = DateAdd(a, gb.Day, 10)
Print Format(a, "dd/mm/yyyy"), Format(b, "dd/mm/yyyy")
End
o se preferite abbreviato:
Print Format(CDate(Val("1/1/17") - 10), "dd/mm/yyyy")
:ciao: