示例#1
0
        /// <summary>
        /// Returns the <see cref="DateRange"/> representation from a given string.
        /// <para>String representations of dates are always expressed in Coordinated Universal Time(UTC)</para>
        /// </summary>
        /// <exception cref="FormatException" />
        public static DateRange Parse(string value)
        {
            var match = DateRange.MultipleBoundariesRegex.Match(value);

            if (!match.Success)
            {
                return(new DateRange(DateRangeBound.Parse(value)));
            }
            return(new DateRange(
                       DateRangeBound.Parse(match.Groups[1].Value),
                       DateRangeBound.ParseUpperBound(match.Groups[2].Value)));
        }