Skip to content

Instantly share code, notes, and snippets.

@kevinblake
Created December 6, 2012 16:41
Show Gist options
  • Save kevinblake/4225907 to your computer and use it in GitHub Desktop.
Save kevinblake/4225907 to your computer and use it in GitHub Desktop.
Using timeago.js with C#
List View bound fields
<asp:BoundField DataField="Timestamp" HeaderText="Timestamp" ReadOnly="True" SortExpression="Timestamp" HtmlEncode="False" DataFormatString="<abbr class='timeago' title='{0:yyyy'-'MM'-'dd HH':'mm':'ss'Z'}'>{0}</abbr>" />
In code:
DateTime.UtcNow.ToString("yyyy-MM-dd HH:mm:ssZ");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment