示例
Program.cs
using System;
using System.Collections.Generic;
namespace DateTimeExample
{
class Person
{
public string PersonName { get; set; }
public DateTime DateOfBirth { get; set; }
}
class Program
{
static void Main()
{
Person person1 = new Person();
person1.PersonName = "Miller";
person1.DateOfBirth = DateTime.Parse("2000-12-31 11:59:59.999 am");
Console.WriteLine(person1.DateOfBirth.ToString());
Console.ReadKey();
}
}
}