CalcAge




age in years = DateDiff("yyyy", birth_date, Date)
'Sfortunatamente questa soluzione da risultati errati

'DateDiff("yyyy", "1/1/1960", "1/15/2000") = 40Giusto

'DateDiff("yyyy", "12/1/1960", "1/15/2000") = 40 Errato

'Soluzione :

Public Sub DateDifference( _
ByVal Date1 As Date, _
ByVal Date2 As Date, _
ByRef num_years As Integer, _
ByRef num_months As Integer, _
ByRef num_days As Integer, _
ByRef num_hours As Integer, _
ByRef num_minutes As Integer, _
ByRef num_seconds As Integer)
End Sub











( calcage.html )- by Paolo Puglisi - Modifica del 17/12/2023