hello i need to calculate age of a person and dispaly it in a label. for example i have a textbox, with these values, 130790, from this number it should generate my age. DDMMYY

What is 130790?

Dim plain As String = "130790"

		If plain.Length <> 6 Then
			Throw New FormatException("wrong format. Please use DDMMYY")
		End If
		
		Dim _date1 As String = plain.Insert(2, ".").Insert(5, ".")
		Dim _date3 As Date = Date.Parse(_date1)

		Console.WriteLine(_date3)
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.