Created
April 5, 2016 11:52
-
-
Save exts/64106e31dc537e824f31ea8422d13109 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//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