class Program
{
static void Main(string[] args)
{
UserInfo userInfo = new UserInfo();
userInfo.CreateTime = DateTime.Now;
string userString = SlJson.ToJson(userInfo);//序列化
UserInfo userInfoAfter = SlJson.FromJson<UserInfo>(userString);//反序列化
Console.WriteLine("時間戳:" + userString);
Console.WriteLine("轉換後:" + userInfoAfter.CreateTime);
Console.WriteLine("本地" + userInfoAfter.CreateTime.ToLocalTime());
Console.ReadKey();
}
}get
public class UserInfo
{
public DateTime CreateTime { get; set; }
}string