title: How to get year in datetimepicker for validation 18
body: <p>I need to validate that a person is above the age of 18 before they can access the site. I am using datetimepicker in bootstrap. </p>
  
  <p>My Code: </p>
  
  <pre><code>$(document).ready(function () {
      $('#txtDOB').datetimepicker({
          maxDate: new Date,
          minDate: new Date(1950, 6, 12),
          onSelect: function (dateText, inst) {
              var month = dateText.getUTCMonth();
              var day = dateText.getUTCDate();
              var year = dateText.getUTCFullYear();
              alert(day + month + year);
          }
      })
  });
  </code></pre>