示例#1
0
        public void AsDateTime_with_valid_date()
        {
            JsonValue jsonValue = JsonValue.NewString("4/23/1982");
            DateTime  result    = jsonValue.AsDateTime();

            Assert.AreEqual(new DateTime(1982, 4, 23), result);
        }
示例#2
0
        public void AsDateTime_with_valid_epoch_date_and_positive_timezone()
        {
            JsonValue jsonValue = JsonValue.NewString(@"/Date(1434067200000+0000)/");
            DateTime  result    = jsonValue.AsDateTime();

            Assert.AreEqual(new DateTime(2015, 6, 12), result);
        }