Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
//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