title: WinRT - How To Get the correct DateTimeFormatter based on the user culture
body: <p>I've some trouble finding the right DateTimeFormatter for the user.</p>
  
  <p>When converting a date to a string for example with </p>
  
  <pre><code>.ToString("D");
  </code></pre>
  
  <p>always the en-US culture is used in WinRT.</p>
  
  <p>I found out that there are new globalization apis which should be used.</p>
  
  <p>for example</p>
  
  <pre><code>       var langs = Windows.System.UserProfile.GlobalizationPreferences.Languages;
  
         var homeregion = Windows.System.UserProfile.GlobalizationPreferences.HomeGeographicRegion;
  
  
             Windows.Globalization.DateTimeFormatting.DateTimeFormatter dtf = new DateTimeFormatter(homeregion);
  </code></pre>
  
  <p>but the result of HomeGeographicRegion is not in the format with a new DateTimeformatter requires</p>
  
  <p>I also tried this</p>
  
  <pre><code> var formatter = new Windows.Globalization.DateTimeFormatting.DateTimeFormatter(Windows.Globalization.DateTimeFormatting.YearFormat.Default,
                  Windows.Globalization.DateTimeFormatting.MonthFormat.Abbreviated,
                  Windows.Globalization.DateTimeFormatting.DayFormat.Default,
                  Windows.Globalization.DateTimeFormatting.DayOfWeekFormat.Default);
  
                  string result = formatter.Format(Date);
  </code></pre>
  
  <p>but that also only returns date string in en-Us format.</p>
  
  <p>Can anyour tell me what is the correct way to get a DateTimeFormatter according to the users culture (which is also automatically used for resource localizations via uid)?</p>