Skip to content

Instantly share code, notes, and snippets.

@jz5
Created February 17, 2015 22:39
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jz5/d82978c0f36296b68a5f to your computer and use it in GitHub Desktop.
Save jz5/d82978c0f36296b68a5f to your computer and use it in GitHub Desktop.
// 現時刻の status id
var currentId = Convert.ToInt64(
DateTime.UtcNow.Subtract(
new DateTime(1970, 1, 1).AddMilliseconds(1288834974657)
).TotalMilliseconds
) << 22;
// 10 minutes 分のミリ秒
var offset = Convert.ToInt64(
TimeSpan.FromMinutes(10).TotalMilliseconds) << 22;
// 10分前の status id
var pastId = currentId - offset;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment