Skip to content

Instantly share code, notes, and snippets.

// A potential example to generating unique IDs as the youtube ID
void Main()
{
long unixTimestamp = (long)(DateTime.UtcNow.Subtract(new DateTime(1970, 1, 1,0,0,0,0))).TotalSeconds;
Console.WriteLine("EPOCH: {0}",unixTimestamp);
long T = unixTimestamp;// DateTime.UtcNow.Ticks;
Console.WriteLine("Current T: {0}",T);
// Convert T to binary
string binary = IntToString(T, new char[] { '0', '1' });