title: "String was not recognized as a valid DateTime" for string format dd/MM/yyyyTHH:mm
body: <p>I am taking in input using a Html.TextBoxFor declared as <code>@Html.TextBoxFor(model =&gt; model.StartDate, new { type = "datetime-local", @class = "form-control", @style = "height:34px;width:230px" })</code> there are two of these both of which pass their values through AJAX to a C# controller function which does the following </p>
  
  <p><code>DateTime ResourceStart = DateTime.ParseExact(resource_start, "dd/MM/yyyyTHH:mm", CultureInfo.InvariantCulture);</code></p>
  
  <p><code>DateTime ResourceDue = DateTime.ParseExact(resource_due, "dd/MM/yyyyTHH:mm", CultureInfo.InvariantCulture);</code></p>
  
  <p>The values of <code>resource_start</code> and <code>resource_due</code> are "2016-12-02T09:30" and "2016-12-12T12:50" respectively.</p>
  
  <p>The follwing is the exception detail when the program crashes.</p>
  
  <pre><code>System.FormatException was unhandled by user code
    HResult=-2146233033
    Message=String was not recognized as a valid DateTime.
    Source=mscorlib
    StackTrace:
         at System.DateTimeParse.ParseExact(String s, String format, DateTimeFormatInfo dtfi, DateTimeStyles style)
         at System.DateTime.ParseExact(String s, String format, IFormatProvider provider)
         at ITPortal.Areas.ITWorkstream.Controllers.WorkstreamController.CreateResource(Int32 task_id, String resource_start, String resource_due) in c:\Work\ITPortal\ITPortal-DEV\ITPortal\Areas\ITWorkstream\Controllers\WorkstreamController.cs:line 247
         at lambda_method(Closure , ControllerBase , Object[] )
         at System.Web.Mvc.ActionMethodDispatcher.Execute(ControllerBase controller, Object[] parameters)
         at System.Web.Mvc.ReflectedActionDescriptor.Execute(ControllerContext controllerContext, IDictionary`2 parameters)
         at System.Web.Mvc.ControllerActionInvoker.InvokeActionMethod(ControllerContext controllerContext, ActionDescriptor actionDescriptor, IDictionary`2 parameters)
         at System.Web.Mvc.Async.AsyncControllerActionInvoker.ActionInvocation.InvokeSynchronousActionMethod()
         at System.Web.Mvc.Async.AsyncControllerActionInvoker.&lt;BeginInvokeSynchronousActionMethod&gt;b__39(IAsyncResult asyncResult, ActionInvocation innerInvokeState)
         at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`2.CallEndDelegate(IAsyncResult asyncResult)
         at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
         at System.Web.Mvc.Async.AsyncResultWrapper.End[TResult](IAsyncResult asyncResult, Object tag)
         at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
         at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.&lt;InvokeActionMethodFilterAsynchronouslyRecursive&gt;b__3d()
         at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.&lt;&gt;c__DisplayClass46.&lt;InvokeActionMethodFilterAsynchronouslyRecursive&gt;b__3f()
    InnerException:
  </code></pre>
  
  <p>I think my problem lies in the format that I have declared for my string in the ParseExact function, can anyone tell me which format to use instad?</p>