- <block subset="none" type="note">
- <para>See the <see cref="T:System.String" /> class for the list of white space characters.</para>
- <para>Only the <see cref="F:System.Globalization.DateTimeStyles.NoCurrentDateDefault" /> option affects the <see cref="M:System.DateTime.Parse(System.String)" /> method.
-<see cref="M:System.DateTime.Parse(System.String)" /> always
- ignores leading, inner, and trailing white spaces.</para>
- </block>
+ <attribution license="cc4" from="Microsoft" modified="false" />
+ <para>
+ <see cref="T:System.Globalization.DateTimeStyles" /> values can be used with any of the following date and time parsing methods that include a <paramref name="styles" /> parameter to define the interpretation of the style elements that may be present in the string to be parsed:</para>
+ <list type="bullet">
+ <item>
+ <para>
+ <see cref="M:System.DateTime.Parse(System.String)" />
+ </para>
+ </item>
+ <item>
+ <para>
+ <see cref="M:System.DateTimeOffset.Parse(System.String)" />
+ </para>
+ </item>
+ <item>
+ <para>
+ <see cref="M:System.DateTime.TryParse(System.String,System.DateTime@)" />
+ </para>
+ </item>
+ <item>
+ <para>
+ <see cref="M:System.DateTimeOffset.TryParse(System.String,System.DateTimeOffset@)" />
+ </para>
+ </item>
+ <item>
+ <para>
+ <see cref="M:System.DateTime.ParseExact(System.String,System.String,System.IFormatProvider)" />
+ </para>
+ </item>
+ <item>
+ <para>
+ <see cref="M:System.DateTimeOffset.ParseExact(System.String,System.String,System.IFormatProvider)" />
+ </para>
+ </item>
+ <item>
+ <para>
+ <see cref="M:System.DateTime.TryParseExact(System.String,System.String,System.IFormatProvider,System.Globalization.DateTimeStyles,System.DateTime@)" />
+ </para>
+ </item>
+ <item>
+ <para>
+ <see cref="M:System.DateTimeOffset.TryParseExact(System.String,System.String,System.IFormatProvider,System.Globalization.DateTimeStyles,System.DateTimeOffset@)" />
+ </para>
+ </item>
+ </list>
+ <para>The ParseExact and TryParseExact methods can use any of the <see cref="T:System.Globalization.DateTimeStyles" /> values. However, if none of the Allow* values is selected, the input string must have exactly the same white-space characters as the format string.</para>
+ <para>If the input string does not contain any indication of the time zone, the date and time parsing methods interpret the value of the date and time string based on the time zone setting for the operating system. To convert the date and time to the Universal Time or Greenwich Mean Time (GMT), the application should use the <see cref="F:System.Globalization.DateTimeStyles.AdjustToUniversal" /> value. The same effect can be achieved by calling the <see cref="M:System.DateTime.ToUniversalTime" /> or <see cref="M:System.DateTimeOffset.ToUniversalTime" /> method. However, using the <see cref="F:System.Globalization.DateTimeStyles.AdjustToUniversal" /> value with the date and time parsing method is more efficient.</para>