1 using System;
2 using System.Collections.Generic;
3 using System.Text;
4
5 namespace 作业3
6 {
7 class Program
8 {
9 static void Main(string[] args)
10 {
11 Console.WriteLine("请输入您的出生日期:");
12 string td = Console.ReadLine();
13
14 DateTime dt = DateTime.Now;//现在的日期
15 Console.WriteLine("现在的日期和时间是" + dt);
16 DateTime ndt=Convert.ToDateTime( td);
17
18 TimeSpan ts = dt-ndt;
19 Console.WriteLine("你的生日距现在的时间"+ts);
20
21 DayOfWeek dow = ndt.DayOfWeek;
22 Console.WriteLine("您的生日是"+ndt.DayOfWeek);
23 Console.WriteLine("您的生日是当年的第"+ndt.DayOfYear+"天");
24
25
26
27
28
29 Console.ReadLine();
30
31 }
32
33 }
34 }