DateTime dt = DateTime.Now;
Console.WriteLine(dt.ToString("yyyy-MM-dd")); Console.WriteLine (string.Format ("{0:yyyy-MM-dd}",dt));