Results 1 to 1 of 1
Thread: VB
Hybrid View
-
25th January 2009 21:01 #1Registered User
Join Date: Dec:2008
Location: Svishtov
Posts: 19
VB
.
Code:Dim x As String, d,days,years,months As Integer x = TextBox1.Text days = DateDiff(DateInterval.Day, New Date(IIf(x.StartsWith("0"), Val("20" & Mid(x, 1, 2)), Val("19" & Mid(x, 1, 2))), Val(Mid(x, 3, 2)), Val(Mid(x, 5, 2))), New Date(2009, 1, 1)) years=math.truncate(d/365) months=math.truncate((((d/365)-years)*365)/30) days=math.truncate((((((d/365)-years)*365)/30)-months)*30) MsgBox(("years:" & years.ToString)&" "&("months"&months.tostring)&" "&("Days:" & days.ToString)) End Sub
: 21 3 2




Reply With Quote
Lenovo ThinkPad 15 IdeaPad 15
5th May 2023, 22:16 in