Calculate obj Age [Answered]
Program
Student
I am trying to calculate the age, from the birthdate to now. but I am not sure how to do it when using properties
5 Replies
should
DateOfTime
not be DateOfBirth
?
except it's not. a datetime minus a datetime results in a timespan
how stupid
'TimeSpan' does not contain a definition for 'TotalYears'
Ah okay thanks, if I get it as days I can just devide it by 365 and by doing that get the years
This is correct right? I am trying to converting it to a string?
Whops
It's fixed now, thanks for the help
Thanks again
But I get -51 for some reason
That is werid
I feel like there shouldn't be a set
You can't set the age of a person
You can't set their date of birth either
It's fixed now, now it says +51 instead
Remove set? Hmm, it does seem kinda useless here, that is true
✅ This post has been marked as answered!