using System.Security.Cryptography;
public static void Main()
var pastDate = now.AddDays(-21);
Console.WriteLine(now.ToString());
Console.WriteLine(pastDate.ToString());
Console.WriteLine("Date is passed");
{Console.WriteLine("Date not passed");}
public static string EncryptPassword(string data, string salt)
SHA256 hasher = SHA256.Create();
byte[] hashedData = hasher.ComputeHash(Encoding.Unicode.GetBytes(data));
StringBuilder sb = new StringBuilder(hashedData.Length * 2);
foreach (byte b in hashedData)
sb.AppendFormat("{0:x2}", b);