title: How to pass DateTime parameter using Web API attribute routing?
body: <p>I am working on a REST API with ASP.NET Web API 2.
  Thing get bad when I try to integrate dates into the game.</p>
  
  <p>Here is the route:</p>
  
  <pre><code>[Route("{id:Guid}/{from:DateTime}/{to:DateTime}")]
  </code></pre>
  
  <p>When I do that I can perfectly pass something like </p>
  
  <pre><code>.../[id]/2012-01-01/2013-01-01
  </code></pre>
  
  <p>However, when I get to the point where I need the time information it gets quite bad, let's imagine this one:</p>
  
  <pre><code>.../[id]/2012-01-01/2013-01-01 1:45:30 PM/2013-01-01 1:45:30 PM
  </code></pre>
  
  <p>It seems like the spaces are going OK but the ":" are blocking. So I though I should use my own format, being yyyyMMddhhmm. This gives the following URL:</p>
  
  <pre><code>.../[id]/201301031147/201401031147
  </code></pre>
  
  <p>However, .NET is not expecting this as a DateTime and does not know how to use it. So I used a IHttpRouteConstraint to allow it.
  The problem is that it still does not know how to deal with it after I told it it's fine...</p>
  
  <p>So my question is, how do you pass a DateTime to the route?</p>