public static void Main()
var ogTime = DateTime.UtcNow;
Console.WriteLine("ORIGINAL DATETIME: {0}", ogTime);
Console.WriteLine("___________________________________________\n");
byte[] time = BitConverter.GetBytes(ogTime.ToBinary());
Console.WriteLine("ORIGINAL DATETIME BYTES: {0}\n", BitConverter.ToString(time));
byte[] key = Guid.NewGuid().ToByteArray();
string token = Convert.ToBase64String(time.Concat(key).ToArray());
Console.WriteLine("STRING TOKEN: {0}\n", token);
byte[] tokenBytes = Convert.FromBase64String(token);
long arg = BitConverter.ToInt64(tokenBytes, 0);
Console.WriteLine("64-BIT INT ARG FOR DATETIME.FROMBINARY(): {0}\n", arg);
DateTime rebuiltDateTime = DateTime.FromBinary(arg);
Console.WriteLine("___________________________________________\n");
Console.WriteLine("REBUILT DATETIME: {0}\n", rebuiltDateTime);
if (rebuiltDateTime > DateTime.UtcNow.AddSeconds(-seconds))
Console.WriteLine("It has been LESS than 4 seconds since the token was generated.");
if (rebuiltDateTime < DateTime.UtcNow.AddSeconds(-seconds))
Console.WriteLine("It has been MORE than 4 seconds since the token was generated.");