Skip to content

Instantly share code, notes, and snippets.

@exts
Created April 5, 2016 11:52
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save exts/64106e31dc537e824f31ea8422d13109 to your computer and use it in GitHub Desktop.
//idiotcoder.com
class Post
{
private long timestamp = 0;
public long HourAgo {
get { return timestamp - (60 * 60); }
}
public Post(long unixTimestamp)
{
timestamp = unixTimestamp;
}
}
class Program
{
static void Main()
{
var post = new Post(1459857080); // 04/05/2016 @ 11:51am (UTC)
System.Console.WriteLine(post.HourAgo); // 04/05/2016 @ 10:51am (UTC)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment