Beispiel #1
0
        /// <summary>
        ///   Converts the specified string representation of a date and time to its <see cref="HdDateTime" /> equivalent. The
        ///   format of the string representation must match the specified format exactly.
        /// </summary>
        /// <param name="source">A string containing a date and time to convert.</param>
        /// <param name="format">
        ///   A format specifier, that defines the required format of <paramref name="source" />. The format of
        ///   the string representation must match the specified format exactly.
        /// </param>
        /// <returns>
        ///   An object that is equivalent to the date and time contained in <paramref name="source" />, as specified by
        ///   <paramref name="format" />.
        /// </returns>
        /// <remarks>
        ///   A date and time format, which can be the same as <see cref="System.DateTime" /> format. If you want to specify
        ///   nanoseconds formatting, you can use "FFFFFFFFF" (9 Fs) or "fffffffff" (9 fs).
        /// </remarks>
        public HdDateTime ParseExact(String source, String format)
        {
            String ownSource = String.Copy(source);
            String ownFormat = GetAllocatedFormat(format);

            return(PreciseTimeParse.ParseExact(ownSource, ownFormat, null));
        }
Beispiel #2
0
        /// <summary>
        ///   Converts the specified string representation of a date and time to its <see cref="HdDateTime" /> equivalent and
        ///   returns a value that indicates whether the conversion succeeded. The format of the string representation must match
        ///   the specified format exactly.
        /// </summary>
        /// <param name="source">A string containing a date and time to convert.</param>
        /// <param name="format">
        ///   A format specifier, that defines the required format of <paramref name="source" />. The format of
        ///   the string representation must match the specified format exactly.
        /// </param>
        /// <param name="provider">An object that supplies culture-specific formatting information.</param>
        /// <param name="result">
        ///   An object that is equivalent to the date and time contained in <paramref name="source" />, as specified by
        ///   <paramref name="format" />.
        /// </param>
        /// <returns>
        ///   A value that indicates whether the conversion succeeded.
        /// </returns>
        /// <remarks>
        ///   A date and time format, which can be the same as <see cref="System.DateTime" /> format. If you want to specify
        ///   nanoseconds formatting, you can use "FFFFFFFFF" (9 Fs) or "fffffffff" (9 fs).
        /// </remarks>
        public Boolean TryParseExact(String source, String format, IFormatProvider provider, out HdDateTime result)
        {
            String ownSource = String.Copy(source);
            String ownFormat = GetAllocatedFormat(format);

            return(PreciseTimeParse.TryParseExact(ownSource, ownFormat, provider, out result));
        }
Beispiel #3
0
        /// <summary>
        ///   Converts the specified string representation of a date and time to its <see cref="HdDateTime" /> equivalent.
        /// </summary>
        /// <param name="provider">An object that supplies culture-specific format information about <paramref name="source" />.</param>
        /// <param name="source">A string containing a date and time to convert.</param>
        /// <returns>
        ///   An object that is equivalent to the date and time contained in <paramref name="source" />.
        /// </returns>
        public HdDateTime Parse(String source, IFormatProvider provider)
        {
            String ownSource = String.Copy(source);

            return(PreciseTimeParse.Parse(ownSource, provider));
        }
Beispiel #4
0
        /// <summary>
        ///   Converts the specified string representation of a date and time to its <see cref="HdDateTime" /> equivalent.
        /// </summary>
        /// <param name="source">A string containing a date and time to convert.</param>
        /// <returns>
        ///   An object that is equivalent to the date and time contained in <paramref name="source" />.
        /// </returns>
        public HdDateTime Parse(String source)
        {
            String ownSource = String.Copy(source);

            return(PreciseTimeParse.Parse(ownSource, null));
        }
Beispiel #5
0
        /// <summary>
        ///   Converts the specified string representation of a date and time to its <see cref="HdDateTime" /> equivalent and
        ///   returns a value that indicates whether the conversion succeeded.
        /// </summary>
        /// <param name="source">A string containing a date and time to convert.</param>
        /// <param name="provider">An object that supplies culture-specific formatting information.</param>
        /// <param name="result">
        ///   An object that is equivalent to the date and time contained in <paramref name="source" />.
        /// </param>
        /// <returns>
        ///   A value that indicates whether the conversion succeeded.
        /// </returns>
        public Boolean TryParse(String source, IFormatProvider provider, out HdDateTime result)
        {
            String ownSource = String.Copy(source);

            return(PreciseTimeParse.TryParse(ownSource, provider, out result));
        }
Beispiel #6
0
        /// <summary>
        ///   Converts the specified string representation of a date and time to its <see cref="HdDateTime" /> equivalent and
        ///   returns a value that indicates whether the conversion succeeded.
        /// </summary>
        /// <param name="source">A string containing a date and time to convert.</param>
        /// <param name="result">
        ///   An object that is equivalent to the date and time contained in <paramref name="source" />.
        /// </param>
        /// <returns>
        ///   A value that indicates whether the conversion succeeded.
        /// </returns>
        public Boolean TryParse(String source, out HdDateTime result)
        {
            String ownSource = String.Copy(source);

            return(PreciseTimeParse.TryParse(ownSource, null, out result));
        }