Ejemplo n.º 1
0
        /// <summary>
        /// Converts the Isodate time.
        /// </summary>
        /// <param name="iso8601Date">The iso8601 date.</param>
        /// <returns></returns>
        public static DateTime ConvertToLocalDateTime(string iso8601Date)
        {
            object result = Converter.ConvertFromInvariantString(iso8601Date);

            if (result != null)
            {
                return((DateTime)result);
            }
            return(DateTime.MinValue);
        }
        public void ConvertFromString()
        {
            DateTime today221 = DateTime.Today.AddHours(2).AddMinutes(21).ToLocalTime();
            DateTime utc      = today221.ToUniversalTime();


            string value = utc.ToString("yyyy-MM-ddTHH:mm:ssZ");

            Assert.That(typeConverter.ConvertFromInvariantString(value), Is.EqualTo(today221));
        }