static void Main(string[] args) { BirthdayInfo birth = new BirthdayInfo(); birth.Name = "아이유"; birth.Birthday = new DateTime(1993, 5, 16); Console.WriteLine($"Name:{birth.Name}"); Console.WriteLine($"Birthday:{birth.Birthday.ToShortDateString()}"); Console.WriteLine($"age:{birth.age}"); Console.WriteLine(new DateTime(1, 1, 1, 12, 10, 10).Ticks); Console.WriteLine(new DateTime(1, 1, 1, 12, 10, 11).Ticks); Console.WriteLine(new DateTime(438110000000)); }
static void Main(string[] args) { BirthdayInfo b1 = new BirthdayInfo(); b1.Name = "아이유"; b1.Birthday = new DateTime(1993, 5, 16); Console.WriteLine(DateTime.Now.Subtract(b1.Birthday).Ticks); Console.WriteLine(new DateTime(0001, 1, 1, 12, 1, 1).Ticks); Console.WriteLine(new DateTime(0001, 1, 1, 12, 1, 2).Ticks); Console.WriteLine(new DateTime(432620000000)); Console.WriteLine($"Name: {b1.Name}"); Console.WriteLine($"Birthday: {b1.Birthday}"); Console.WriteLine($"Age: {b1.Age}"); }