📜  离圣诞节还有几天 - C# 代码示例

📅  最后修改于: 2022-03-11 14:48:57.729000             🧑  作者: Mango

代码示例2
public void DaysTillXmas()
{
    DateTime Xmas = new DateTime(DateTime.Now.Year, 12, 25);
    TimeSpan diff = (Xmas - DateTime.Now);
    Console.WriteLine(diff.Days + " Days till Christmas.");
}