- 01
- 02
- 03
- 04
- 05
- 06
- 07
- 08
- 09
- 10
- 11
/// <summary>Read-Only property. Gets the Age.</summary>
public Int32 Age {
get {
Int32 age = 0;
if(this.dateOfBirth != DateTime.MaxValue){
String temp = (DateTime.Now.Subtract(this.dateOfBirth).TotalDays / 365).ToString();
age = Convert.ToInt32(temp.Substring(0, temp.IndexOf(".")));
}
return (age);
}
}
Между прочим, высокосные года никто не отменял