Ejemplo n.º 1
0
        public void ToLocalTimeString_FormatTest()
        {
            var localDatetime = new DateTime(2018, 5, 6, 11, 22, 33, 111, DateTimeKind.Local);
            var utc           = new DateTimeUtc(localDatetime.ToUniversalTime());

            Assert.Equal(localDatetime.ToString("O"), utc.ToLocalTimeString("O"));
        }
Ejemplo n.º 2
0
        public void ToLocalTimeString_Test()
        {
            var datetime = new DateTime(2018, 5, 6, 11, 22, 33, 111, DateTimeKind.Local);
            var utc      = new DateTimeUtc(datetime.ToUniversalTime());

            Assert.Equal(datetime.ToString(), utc.ToLocalTimeString());
        }