'Tony Jones, Queensland, Australia
'Email: tvtech@homemail.com
'Southern Cross Visual Basic Code and Links
'http:www.geocities.com/~scvb/index.html
'Displays the differene between two dates
'11-11-97 to 01-01-01 (Next century!)
'Returns: Days formatted with ',' delimiter, as used
'in Southern Hemisphere ie Australia, New Zealand
Label2 = "The difference between 11-11-97 to 01-01-01 is:"
Label1 = Format$(days360("11-11-97", "01-01-01"), "###,###") & " days"
End Sub
Public Function days360(dt1 As Date, dt2 As Date) As Long
Dim z1 As Long, z2 As Long
Dim d1 As Long, d2 As Long
Dim m1 As Long, m2 As Long
Dim y1 As Long, y2 As Long
d1 = Day(dt1)
m1 = Month(dt1)
y1 = Year(dt1)
d2 = Day(dt2)
m2 = Month(dt2)
y2 = Year(dt2)
If d1 = 31 Then
z1 = 30
Else
z1 = d1
End If
If d2 = 31 And d1 >= 30 Then
z2 = 30
Else
z2 = d2
End If