title: MFC Formatting Dates with Locale
body: <p>I have to print out a date in "extendend mode", like this:</p>
  
  <pre><code>Thursday 02 August 2013
  </code></pre>
  
  <p>Using COleDateTime I have no problems, but I need to print this stuff in local language, in my case Italian. I've found this code in an old compiler that use base SDK commands:</p>
  
  <pre><code>char                            lpDateStr[128], lpTimeStr[128];
  SYSTEMTIME                      today;
  WString                         str;
  
  FileTimeToSystemTime( &amp;IdUnicoK1, &amp;today );
  GetDateFormat( LOCALE_USER_DEFAULT, DATE_LONGDATE, &amp;today, NULL, lpDateStr, sizeof(lpDateStr) );
  GetTimeFormat( LOCALE_USER_DEFAULT, TIME_FORCE24HOURFORMAT, &amp;today, NULL, lpTimeStr, sizeof(lpTimeStr) );
  str.Sprintf( "%s,  %s", lpDateStr, lpTimeStr );
  </code></pre>
  
  <p>that in MFC, according to the MSDN is:</p>
  
  <pre><code>SYSTEMTIME stBuf;
  CString    strD;
  CString    strT;
  CString    strData;
  
  FileTimeToSystemTime( &amp;m_pK1-&gt;m_ftMyData, &amp;stBuf );
  strD = _T("dddd dd MMMM yyyy");
  GetDateFormat( LOCALE_USER_DEFAULT, DATE_LONGDATE, &amp;stBuf, NULL, strD.GetBuffer(), strD.GetLength() );
  strT = _T("HH':'mm':'ss");
  GetTimeFormat( LOCALE_USER_DEFAULT, TIME_FORCE24HOURFORMAT, &amp;stBuf, NULL, strT.GetBuffer(), strT.GetLength() );
  strData.Format( _T("%s, %s"), strD, strT );
  </code></pre>
  
  <p>but this lead me to the following result:</p>
  
  <pre><code>dddd dd MMMM yyyy, HH':'mm':'ss
  </code></pre>
  
  <p>Where I'm doing wrong?</p>