VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Calculate your Exact age Simple Code

by I. Ahmed (1 Submission)
Category: String Manipulation
Compatability: VB 6.0
Difficulty: Unknown Difficulty
Originally Published: Thu 27th January 2005
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Calculate your Exact age Simple Code

API Declarations


text1 put your date of birth (dd/mm/yyyy)
text2 put present or desired day (dd/mm/yyyy)


Dim a, b, c, d, e, f


Rate Calculate your Exact age Simple Code



a = DateDiff("yyyy", TextBox1.Text, TextBox2.Text)' calculate year
b = DateDiff("d", TextBox1.Text, TextBox2.Text) ' calc days
c = DateDiff("m", TextBox1.Text, TextBox2.Text)' calc months
d = (b * 24) ' calc hours 
e = (d * 60) ' calc minutes 
f = (e * 60) ' calc seconds
MsgBox a & " Years  " & vbCrLf & b & " Days " & vbCrLf & c & " Months " & vbCrLf & d & " Hours " & vbCrLf & e & " Minutes " & vbCrLf & f & " Seconds", , "Exact Age"
End Sub


Download this snippet    Add to My Saved Code

Calculate your Exact age Simple Code Comments

No comments have been posted about Calculate your Exact age Simple Code. Why not be the first to post a comment about Calculate your Exact age Simple Code.

Post your comment

Subject:
Message:
0/1000 characters