title: MOSS 2007: SPListItem.GetFormattedValue for DateTime fields has a bug?
body: <p>SPListItem.GetFormattedValue seems to have a strange behavior for DateTime fields.
  It retrieves the DateTime value through SPListItem's indexer which according to this <a href="http://msdn.microsoft.com/en-us/library/ms197282.aspx" rel="noreferrer">MSDN article</a> returns <em>local</em> time.
  Here's a snippet from Reflector</p>
  
  <pre><code>public string GetFormattedValue(string fieldName)
  {
      SPField field = this.Fields.GetField(fieldName);
      if (field != null)
      {
          return field.GetFieldValueAsHtml(this[fieldName]);
      }
      return null;
  }
  </code></pre>
  
  <p>So it uses SPListItem's indexer to retrieve the value and than SPFields.GetFieldValueAsHtml to format the value. GetFieldValueAsHtml seems to assume the date is in UTC and convert it to local time no matter what kind it is. (Reflector shows that it uses GetFieldValueAsText which uses value.ToString() but for some reason it assumes the time to be UTC.)</p>
  
  <p>The end result is that the string representation on a time field obtained trough listItem.GetFormattedValue() (at least in my case) is incorrect, being local time + (local time - UTC).</p>
  
  <p>Have anybody encountered the same issue with SPListItem.GetFormattedValue() and what was your workaround?</p>