title: Converting String to DateTime BetweenTwo Classes
body: <p>For a project I am doing, I have to have the all the details of a person in a separate Person class, which includes a DateTime for their DOB.
  The code from the Person class is:  </p>
  
  <pre><code>public Customer(string firstName, string lastName, string address, string 
  dateOfBirth, string contactNumber, string email)
      {
          _FirstName = firstName;
          _LastName = lastName;
          _Address = address;
          _DateOfBirth = dateOfBirth;
          _ContactNumber = contactNumber;
          _Email = email;
      }
  
  private string _DateOfBirth;
      public string DateOfBirth
      {
          get { return _DateOfBirth; }
          set { _DateOfBirth = value.ToDateTime(); }
      }
  public override string ToString()
      {
          return string.Format("Name: {0} {1}, Address: {2}, DOB: {3}, Contact: {3}, Email: {4}, Total Balance: 6", _LastName, _FirstName, _Address, _DateOfBirth, _ContactNumber, _Email /*Add total balance*/);
      }
  </code></pre>
  
  <p>The input for it within the Program Class would be</p>
  
  <pre><code>Customer c1 = new Customer("First name: Arley, ", "Last name: Praise, ", "Address: 12 Hay Rd, ", "Date of birth (DD / MM / YYYY): 02 / 10 / 1990, ", "Mobile: 0412232116, ", "Email: arleyp @gmail.com");
  </code></pre>
  
  <p>Which is why I'm trying to convert the string to DateTime. However, in the Person class, it comes up with the error CS1061 for</p>
  
  <pre><code>value.ToDateTime();
  </code></pre>
  
  <p>I tried fixing it and looking at other threads with similar problems but I haven't been able to come up with anything. If there's a better way of doing it, or simply fixing the error, any help will be amazing!</p>