Alternatives
Members may post updates or alternatives to this current article in order to show different
approaches or add new features.
It looks like your trying to get the age in years using DateTime.Now and the birth date.This will do just that.DateTime today = DateTime.Today;int calc1 = (today.Year * 100 + today.Month) * 100 + today.Day;int calc2 = (dateOfBirth.Year * 100 + dateOfBirth.Month) * 100 +...
The code has serious issues it wont even compile.You are totally confused with the conversions. I would suggest understand the basics of assignment operations too.you are trying to store a string data into an integer variable 'age' at the following location which is wrong you never store a...
13 Jan 2013Andreas Gieriet
Your code is rather weird.You seem to have little understanding of the C# type system[^].You seem to try to calculate a start date/time by subtract some "age" from "now".What is "age"? seconds, minutes, hours, days, weeks, monts, years, centuries, mayan-cycles ;-)...?Anyways: when...
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.