title: Validate DateTime with FluentValidator
body: <p>This is my <strong>ViewModel</strong> class:</p>
  
  <pre><code>public class CreatePersonModel
  {
      public string Name { get; set; }
      public DateTime DateBirth { get; set; }
      public string Email { get; set; }
  }
  </code></pre>
  
  <p><strong>CreatePerson.cshtml</strong></p>
  
  <pre><code>@model ViewModels.CreatePersonModel
  @{
      ViewBag.Title = "Create Person";
  }
  
  &lt;h2&gt;@ViewBag.Title&lt;/h2&gt;
  
  @using (Html.BeginForm())
  {
      &lt;fieldset&gt;
          &lt;legend&gt;RegisterModel&lt;/legend&gt;
  
          @Html.EditorForModel()
  
          &lt;p&gt;
              &lt;input type="submit" value="Create" /&gt;
          &lt;/p&gt;
      &lt;/fieldset&gt;
  }
  </code></pre>
  
  <p><strong>CreatePersonValidator.cs</strong></p>
  
  <pre><code>public class CreatePersonValidator : AbstractValidator&lt;CreatePersonModel&gt;
  {
      public CreatePersonValidator()
      {
          RuleFor(p =&gt; p.Name)
              .NotEmpty().WithMessage("campo obrigatório")
              .Length(5, 30).WithMessage("mínimo de {0} e máximo de {1} caractéres", 5, 30)
              .Must((p, n) =&gt; n.Any(c =&gt; c == ' ')).WithMessage("deve conter nome e sobrenome");
  
          RuleFor(p =&gt; p.DateBirth)
              .NotEmpty().WithMessage("campo obrigatório")
              .LessThan(p =&gt; DateTime.Now).WithMessage("a data deve estar no passado");
  
          RuleFor(p =&gt; p.Email)
              .NotEmpty().WithMessage("campo obrigatório")
              .EmailAddress().WithMessage("email inválido")
              .OnAnyFailure(p =&gt; p.Email = "");
      }
  }
  </code></pre>
  
  <p><strong>When trying to create a person with an invalid date format:</strong></p>
  
  <p><img src="https://i.stack.imgur.com/pKtur.png" alt="Error trying to save the person"></p>
  
  <h2>Observations</h2>
  
  <p>As in my CreatePersonModel class the <code>DateBirth</code> property is a <code>DateTime</code> type, the asp.net MVC validation has done for me.</p>
  
  <p>But I want to customize the error message <strong>using the FluentValidation</strong>.</p>
  
  <p><strong>I do not want to change the type of property</strong> for various reasons such as:</p>
  
  <p>In a <code>CreatePersonValidator.cs</code>  class, validation is to check if the date is in the past:</p>
  
  <pre><code>.LessThan (p =&gt; DateTime.Now)
  </code></pre>
  
  <h2>Question</h2>
  
  <p>How to customize the error message <strong>without using DataAnnotations</strong> (using FluentValidator).</p>