Display DateTime in GridView using user's time

Posted by Rachel Martin on Stack Overflow See other posts from Stack Overflow or by Rachel Martin
Published on 2010-04-28T19:26:12Z Indexed on 2010/04/28 19:37 UTC
Read the original article Hit count: 348

Filed under:
|
|
|

I have a DateTime stored in UTC time that I'd like to display to the user in their local time from within a GridView control. How can I convert my DateTime to the user's time (not my server's local time)? Here is my current field as it appears in the GridView Columns collection:

<asp:BoundField DataField="RunTime" HeaderText="Run Time"
  SortExpression="RunTime" DataFormatString="{0:f}" />

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about gridview