title: Formatting local timestamps with WinRT
body: <p>WinRT uses the <a href="http://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.globalization.datetimeformatting.datetimeformatter.aspx" rel="nofollow">DateTimeFormatter</a> class to turn timestamps into human-readable dates. In C++CX, you'll pass it a <a href="http://msdn.microsoft.com/en-us/library/windows/apps/xaml/windows.foundation.datetime.aspx" rel="nofollow">DateTime</a> instance, which contains a timestamp in UTC time, and let it work its magic.</p>
  
  <p>However, I have an application that consumes timestamps in <em>local</em> time. I'd like to format them and show them to my users, but if I pass the timestamp as is, the DateTimeFormatter will assume that it's UTC and will try to convert it to local time again, resulting in incorrect times.</p>
  
  <p>How can I display local time with WinRT? Is there a way to turn back local time into UTC time?</p>
  
  <p>The timestamps are generated from the machine that consumes them, so there is no risk of timezone confusion. It would also be technically feasible to produce UTC timestamps instead, but this would be rather inconvenient and I'd like to fall back to that only if it's the only way.</p>