title: Synchronize date format between frontend and backend
body: <p>Let's assume we have an application consists of angularjs frontend and asp.net wep api as backend. </p>
  
  <p>Client should use his culture(eg: En-US) when use datepicker. When data will post to backend side I have a specific culture there(eg: Tr-TR). </p>
  
  <p>I want to a system to handle date time format to manage this situation easily. For example whenever client send a request to backend, I should learn his culture from request, then convert my dates to that format while serializing before returning the data. </p>
  
  <p>What type of system I should create?</p>
  
  <p>Since I haven't frontend code yet, I'll share my culture configuration on web api side. </p>
  
  <p><strong>Setting culture</strong></p>
  
  <pre><code>public class CultureConfig
  {
      public static void Register()
      {
          //Get the culture info of the language code
          const string uiLanguage = "Tr";//"En-US";
          var culture = CultureInfo.CreateSpecificCulture(uiLanguage);
          CultureInfo.DefaultThreadCurrentCulture = culture;
          CultureInfo.DefaultThreadCurrentUICulture = culture;
      }
  }
  </code></pre>
  
  <p><strong>Json Serializing Configs:</strong></p>
  
  <pre><code>  var jsonFormatter = config.Formatters.OfType&lt;JsonMediaTypeFormatter&gt;().First();
          jsonFormatter.SerializerSettings = new JsonSerializerSettings()
          {
              ContractResolver = new CamelCasePropertyNamesContractResolver(),
              DateFormatHandling = DateFormatHandling.IsoDateFormat,
              DateTimeZoneHandling = DateTimeZoneHandling.Unspecified,
              Culture = CultureInfo.DefaultThreadCurrentCulture
          };
  </code></pre>